Add error message return support

The errors returned still aren't nice though.