create real errors

The errors passed to on_error should not be object literals
  they should be real errors with real stack traces.