Open Forceres opened 3 weeks ago
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')
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.