add some more information in errors that we get in the javascript.

fixes #24