Middleware for error handling #196
Replies: 2 comments 4 replies
-
|
Yeah I rmember doing the userland <-> genland back in the day, something about formatting the error for tne same reason. I'll find the solution we implemented in another project - basically we just popped out the auto loader from the bootstrap and wired up a few more handlers as we couldnt do it flexibly otherwise. PR looks promising though, maybe we can merge the two concepts into something if it means something really cool |
Beta Was this translation helpful? Give feedback.
-
|
OK so this discussion is closed for now - a pr was merged in that allows a dev to inject and override the catch-all exception handler which allows custom error handlers to intervene where required.. eg db, 500's etc etc. The last general catch-all is still there should any of the custom handlers fail to catch: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/acr-lfr/generate-it-typescript-server/blob/master/src/http/nodegen/middleware/handleHttpException.ts#L17
I want to be able to pipe all errors to a handler that I control.. maybe to send the error to a 3rd party, for example, alert instantly when a 500 happens opposed to relying on something like new relic which does have a bit of a delay.
Off the top of my head, something like https://github.com/acr-lfr/generate-it-typescript-server/blob/master/src/services/PermissionService.ts
A file that is omni-present and does nothing unless you mess with it..
The PR #197 is the idea, in the PR the dev now has control over how to handle the 500 errors and is given the option to inject adhoc 500 error warnings via API calls, emails or pigeons if needed.. or whatever other creative concept comes to mind.
@p-mcgowan @zewish @acrontum-sanchez
Beta Was this translation helpful? Give feedback.
All reactions