Move errors into core
Closed this issue · 1 comments
daffl commented
I'm actually wondering if the errors should become part of the Feathers core. Two reasons:
- Currently the REST provider sets the Method Not Allowed HTTP code manually where it should just throw the appropriate error (see https://github.com/feathersjs/feathers/blob/master/lib/providers/rest/wrappers.js#L16)
- The error middleware should use the same formatter (https://github.com/feathersjs/feathers/blob/master/lib/providers/rest/index.js#L9) than the provider itself.
ekryski commented
Ya I agree. It probably should. At least it should be included in core for the Method Not Allowed error. And... if it's already in core for that reason it may as well be referenced from there by all the other services.
As for the error middleware, it doesn't behave quite the same way as that handler, so they wouldn't actually be the same. Take a look at the new handler here