returns
returns copied to clipboard
Feature request: make the safe decorator add notes to any exceptions that get thrown for better logging
The results.safe decorator is a great tool to transform non railway oriented functions. One downside, however, is that the try-except block makes it harder to know where errors occurred, and therefore harder to debug. Using the add_notes method of Exceptions could fix this. Notes could be added to log what function the error occurred in, and possibly even line numbers.
PR is welcome :)
Done. I tried to follow your styling as much as possible, but please let me know if you would like me to edit anything. Also, see the notes in the pull request for some items I wasn't sure about.