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

CallSite Parameters first exception call stack #652

Open
Forceres opened this issue Sep 25, 2024 · 0 comments
Open

CallSite Parameters first exception call stack #652

Forceres opened this issue Sep 25, 2024 · 0 comments

Comments

@Forceres
Copy link

Forceres commented Sep 25, 2024

Is it possible to retain callsite params if exception is handled on higher level like general exception handler?
Tried to override it manually, but it doesn't work.

def general_exception_handler(error: Exception):
    traceback_exception = TracebackException.from_exception(exc)
    filename = traceback_exception.stack[-1].filename
    lineno = traceback_exception.stack[-1].lineno
    func_name = traceback_exception.stack[-1].name
    module = (traceback_exception.stack[-1].filename.removeprefix(getcwd()).lstrip(os.sep).
              replace('.py', '').replace(os.sep, '.'))
    logger: LoggerProtocol = get_logger(module)
    logger.error(detail, extra=extra, lineno=lineno, func_name='test')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant