Skip to content

Feature request: make the safe decorator add notes to any exceptions that get thrown for better logging #2107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
madkopp opened this issue Apr 11, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@madkopp
Copy link

madkopp commented Apr 11, 2025

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.

@sobolevn
Copy link
Member

PR is welcome :)

@madkopp
Copy link
Author

madkopp commented Apr 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants