Skip to content

Improve error capture for extensions #6908

@hui-zhou-a

Description

@hui-zhou-a

Description of the current limitations

Currently if something goes wrong with the extension, the raised error doesn't have traceback information. It makes very difficult to debug. No traceback in log neither.

Image

Code sample expected

        def report_callback_exception(self, exc, val, tb):
            """Custom exception showing an error message."""

            if not val:
                val = "An error occurred when using the extension."

            sys.last_type = exc
            sys.last_value = val
            sys.last_traceback = tb
            traceback.print_exception(exc, val, tb)
            val =  ''.join(traceback.format_tb(tb))
            showerror("Error", message=f"{val}")

Useful links and references

No response

Metadata

Metadata

Assignees

Labels

enhancementNew features or code improvements

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions