-
Notifications
You must be signed in to change notification settings - Fork 24
Consider using restify/errors as base #31
Comments
Looking at it quickly I'm not sure that I would inherit from that lib directly because we have some stuff in here that makes it easier to handle database errors. That being said, there definitely some REST errors that we should add. We could also potentially do what they do in Restify and programatically grab the errors from the node Good suggestion! |
Well, I didn't mean "inherit from that module" as "replace this module". The handler function would still be here, for sure. I meant |
I like the idea. The more - good and proven - code we don't have to write and maintain the better. As you pointed out error to HTTP code mapping has probably been done a hundred times already. I did have a quick look and it looks like the module is pulling in at least all of |
Yes I agree with @daffl completely. I'll add that right now it's a pretty low priority (at least for me) but if "someone" is up for a PR that also allows us to still use feathers-errors client side it'll definitely get merged. The less we have to write ourselves the better and I absolutely see value in being able to use the restify errors. |
Yep, I totally agree with minimizing external dependencies for the client side. I'll look into upstream patches to minimize those... |
👍 |
I'm going to close this one for now. Thanks again for the suggestion @joshuajabbour. Looking over it again, I think migrating the Restify errors to work on all platforms will be more work at the moment than maintaining our own. |
The restify/errors project seems to have some of the same underlying goals (creating standard representations for common HTTP/REST errors) and includes support for many more errors than Feathers includes by default.
If
FeathersError
extendedRestError
/HttpError
, it might provide even more options for end users.Update: To be clear, I haven't thought about how this might work, but one of my first thoughts in moving from a custom Restify app to Feathers was that I missed the more complete errors functionality.
The text was updated successfully, but these errors were encountered: