-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dumb Question: Awilix perspective on error handling? #3
Comments
Of course I've seen Sillicon Valley, any developer worth their salt has! ;) Awilix does not really deal with error handling - once you've resolved a service it's ready to go; any errors thrown while using these objects is out of Awilix' scope (no pun intended). In other words, Awilix has nothing to do with error handling. :) |
Correct me if I'm wrong, but the order of how awilix functions is: So it is not recommended to create a middleware to pass errors through Awilix and registering it as an error? It's better just to do it through a service file/level? |
Awilix is an IoC container, and does not deal with error handling, thats done by whatever framework you're using. I wouldnt use the scope to register errors, only things like session state (thats what scopes are for). Hope that helps. :) ~ Jeff Hansen
|
Apologies in advance for the dumb weird question.
It seems like awilix's preferred method of catching errors is from the scope(?) of the container, correct? Or is better to create it first then catch errors whenever creating services attached to it? Or is catching errors on a (general) api level, with a generic handler be the best? I understand it's kind of depends on the project, but I'm curious what would be the best practice in the context of awilix.
Let me know if this question is unclear. Not sure if you've seen silicon valley, but I feel like Bernice asking these questions and using your amazing framework!
The text was updated successfully, but these errors were encountered: