Trouble Understanding Function with tryPromise and Decode in TypeScript
Hello,
I struggle to understand something with a function where I use tryPromise + some decode function.
Here is the snippet
I get an inferred type of:
Which is basically what I want.
However when there's a parsing error in the decode function, it does not seem handled by the Effect error channel and instead it's throwing a low-level error and makes the process crash.
When using decode within a flatmap in other pipelines I don't think I ever encountered such issue, so I assume I am doing something wrong with the tryPromise maybe, but I cannot seem to find what's wrong
I struggle to understand something with a function where I use tryPromise + some decode function.
Here is the snippet
I get an inferred type of:
Which is basically what I want.
However when there's a parsing error in the decode function, it does not seem handled by the Effect error channel and instead it's throwing a low-level error and makes the process crash.
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().When using decode within a flatmap in other pipelines I don't think I ever encountered such issue, so I assume I am doing something wrong with the tryPromise maybe, but I cannot seem to find what's wrong
