Financial-Times / o-errors

Decoupled client-side error-logging
http://registry.origami.ft.com/components/o-errors
1 stars 2 forks source link

Custom error classes reported as `[object Object]` #21

Open kornelski opened 8 years ago

kornelski commented 8 years ago
function CustomError() {this.reason = "whoops"}

require('o-errors').report(new CustomError());

In Sentry the error message is "[object Object]".

I'd expect "CustomError" (.constructor.name) or {"reason":"whoops"} (JSON representation) instead.

kornelski commented 8 years ago

I've worked around this in the webapp for now (I'm using transform callback to extract some message and move the rest to the context obj)