Hey,
I'm using ApiProblem.create() to create custom API problems. I then (among other things) send them to @getsentry for further internal error reporting.
To not have all errors that are the result of an ApiProblem to be grouped under "HTTP-Problem", I tried to set the .name property, however I get
TypeError: Cannot assign to read only property 'name' of function
mostly because of this line:
| constant(this,'name','HTTP-Problem',true); |
Is there a specific reason for that lock-down on writable properties ?
Could name be a parameter, so that users of this lib have some influence over
HTTP-Problem: [400] my error description > https://problems.example.com/myerror12'
to say
MyCustomError: [400] my error description > https://problems.example.com/myerror12'
when stringifying ?
Or is there another way (apart from the documented new (ApiProblem.create())) to subclass ApiProblem ?
Hey,
I'm using
ApiProblem.create()to create custom API problems. I then (among other things) send them to @getsentry for further internal error reporting.To not have all errors that are the result of an ApiProblem to be grouped under "HTTP-Problem", I tried to set the
.nameproperty, however I getmostly because of this line:
node-api-problem/lib/apiProblem.js
Line 44 in 4071cfd
Is there a specific reason for that lock-down on writable properties ?
Could
namebe a parameter, so that users of this lib have some influence overto say
when stringifying ?
Or is there another way (apart from the documented
new (ApiProblem.create())) to subclassApiProblem?