Skip to content
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

Feature: Modify custom exceptions to search through the stack frames for the function name and its arguments #15

Open
arizvisa opened this issue Sep 23, 2018 · 0 comments

Comments

@arizvisa
Copy link
Owner

Whenever an exception is thrown, or a message is logged (using logging.root) the function that caused it, its arguments, and an error message is manually put together via a format-spec. This is fucking horrible to maintain and there's some cases where they're inconsistent (or I missed some variables in my format-spec). This is because this sort of stuff is a real bitch to test (large project without unit-testing syndrome).

It'd be nice if there's some way to automatically determine these things at the time the exception is raised so that way this would be a little bit more manageable. Maybe this would have to be done by requiring all custom-exceptions include an argument with the function name and its parameters. Then one can look at the types defined by the "multicase" decorator and automatically output that part.

If it's possible to walk through the stack frame (similar to internal.interface.address.pframe), however, then this would be awesome because it could be made to be entirely automatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant