Effect CommunityEC
Effect Community3mo ago
3 replies
kevinww

UnknownException trace

How can I print the line that caused an UnknownException?

I have something like:
Effect.gen(function* () {
  yield* tryPromise(() => doFoo());
  yield* tryPromise(() => doBar());
}).pipe(
  Effect.catchTags({
    UnknownException: (e) => {
      console.error("Mysterious error", e);
    },
  })
)


How do I get the "Mysterious error" line to tell me whether it was doFoo() or doBar() that had the exception?
Was this page helpful?