Pass errors as Error instances rather than strings.

http://www.devthought.com/2011/12/22/a-string-is-not-an-error/

All the errors that originate from JavaScript already seem to be Error instances, so this is probably just an oversight in the C++ code.