Skip to content

rBrenick/exception-dialog

Repository files navigation

exception-dialog

Simple dialog that shows exceptions when they occur.

tool header image

Install

1. Download this package and unzip it in a good location 
    1.B (or git clone it directly if you have git installed)
2. Run installer.bat (will walk you through some options for install)
3. Restart the DCC

Start the tool

The exception dialog will register itself to the sys.excepthook of the python interpreter.

The recommended approach is to trigger this function here during startup.

import exception_dialog
exception_dialog.startup()

Extending the tool

During startup, the tool will search through the sys.path for any .py file starting with "exception_dialog_ext"

If it finds a file matching that pattern, it will import it.

So, for example, if there's a file called exception_dialog_ext_slack_actions.py in any sys.path folder. It will be imported.

Here's what such a file might look like:

import exception_dialog.exception_dialog_system as eds

class SlackExceptionAction(eds.BaseExceptionAction):
    label = "Get Help in Slack"
    icon_name = "slack_icon"
    show_button = True  # show a button for this action in the dialog
    is_automatic = False  # should this action trigger automatically during an exception
    
    @staticmethod
    def trigger_action(exc_trace, exc_value, exc_typ):
        print("Trigger something in slack")

Subclasses of BaseExceptionAction are automatically added to the dialog if show_button is set to True.

They can also be triggered from the exception by setting is_automatic to True.

About

Simple dialog that shows exception when they occur

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published