Skip to content

Clean printed exception backtraces from irrelevant stack frames #445

@eabatalov

Description

@eabatalov

Consider fully removing/reducing the backtraces and only leaving the error message for the following exceptions:

  • SDKUsageError
  • SerializationError
  • DeserializationError
  • FunctionError
  • FunctionTimeoutError

This is because when we do traceback.format_exception/traceback.print_exception on these exceptions,
the backtrace include internal SDK code paths that are useless for the users because the errors are originating in their code.

However, the tricky part here is that we can't just clear all the backtraces in some cases. i.e. if a user function code at line X is at the bottom of the call stack. In this case it'd be really useful for the user to see their function code line in the backtrace to connect cause and effect on why the exception got raised.

This needs to work consistently both in local mode and FE (remote) modes as both are printing exception backtraces (including cloud events).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions