Is there any way to get a stack trace from errors?
I have some PathDoesNotExist error reaching the top level of my basic-cli main function but it's quite annoying to try figuring out what line caused it originally.
I find wrapping my errors with another tag is a nice way to add additional context. Then when it bubbles all the way to the top (if I don't handle it) then I get a more helpful error message.
Here is an example that uses mapErr
with a tag.
I also find adding type annotations can help on functions, or using the hover in my editor to see the inferred type at a given point, can help track down where it's coming from.
Theoretically crashing with the error can give a backtrack, but I don't think it is reliable
Last updated: Jul 05 2025 at 12:14 UTC