Skip to content

Provide a user friendly error if the user can't run workbox code#56

Merged
MHendricks merged 1 commit intomainfrom
mikeh/shortcut_helper
Mar 3, 2026
Merged

Provide a user friendly error if the user can't run workbox code#56
MHendricks merged 1 commit intomainfrom
mikeh/shortcut_helper

Conversation

@MHendricks
Copy link
Member

If the user hasn't setup a workbox and accidentally uses the keyboard shortcuts to run workbox code it will now provide a error to point them to the correct shortcut.

Checklist

  • I have read the CONTRIBUTING.md document
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation regarding my changes where necessary
  • Any pre-existing tests continue to pass
  • Additional tests were made covering my changes

Types of Changes

  • Bugfix (change that fixes an issue)
  • New Feature (change that adds functionality)
  • Documentation Update (if none of the other choices apply)

Proposed Changes

The old error message:

Traceback (most recent call last):
  File "[C:\blur\dev\preditor\preditor\gui\loggerwindow.py](c:\blur\dev\preditor\preditor\gui\loggerwindow.py, , 1336)", line 1336, in execAll
    self.current_workbox().__exec_all__()
AttributeError: 'NoneType' object has no attribute '__exec_all__'

The new error message:

Traceback (most recent call last):
  File "C:\blur\dev\preditor\preditor\gui\loggerwindow.py", line 1340, in execAll
    raise RuntimeError(
RuntimeError: You must choose an Editor Class in the workbox section before you can run code from it. (To run console code don't use Shift or Ctrl when pressing Return.)

If the user hasn't setup a workbox and accidentally uses the keyboard
shortcuts to run workbox code it will now provide a error to point them
to the correct shortcut.
@MHendricks MHendricks merged commit a107c0b into main Mar 3, 2026
21 checks passed
@MHendricks MHendricks deleted the mikeh/shortcut_helper branch March 3, 2026 03:13
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

Successfully merging this pull request may close these issues.

1 participant