Adding Error Verification for API Handlers in Effect Typescript Library
Hi, would be good if there were an option to verify that all reported errors are being thrown in the handler. In this way, the api won't report errors that are then not being used in the handler. I created some helper code for that, is there some existing way how to do this?
api:
handler:
this will compile just fine even though no error is being thrown, because type of
If I use helper that I created:
then if I wouldn't throw any of those errors, then I would get compile error.
Implementation of the
api:
handler:
this will compile just fine even though no error is being thrown, because type of
R in handler is a subtype of type of R in apiIf I use helper that I created:
then if I wouldn't throw any of those errors, then I would get compile error.
Implementation of the
.handleExect helper: