Skip to content

Fix Routing Command Errors Through _on_command_error Instead of _on_error#42

Merged
PenguinBoi12 merged 1 commit intomainfrom
fix-error-handler
Apr 12, 2026
Merged

Fix Routing Command Errors Through _on_command_error Instead of _on_error#42
PenguinBoi12 merged 1 commit intomainfrom
fix-error-handler

Conversation

@PenguinBoi12
Copy link
Copy Markdown
Contributor

@PenguinBoi12 PenguinBoi12 commented Apr 12, 2026

Command errors were bubbling up through _on_matrix_event's generic try/except, routing them to _on_error instead of _on_command_error. Fixed by wrapping _process_commands in a try/except that catches all command-related errors and dispatches them through the on_command_error lifecycle hook, which has access to context.

@PenguinBoi12 PenguinBoi12 changed the title Fix Routing Command Rrrors Through _on_command_error Instead of _on_error Fix Routing Command Errors Through _on_command_error Instead of _on_error Apr 12, 2026
Copy link
Copy Markdown
Contributor

@chrisdedman chrisdedman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PenguinBoi12 PenguinBoi12 merged commit baf39c2 into main Apr 12, 2026
4 checks passed
@PenguinBoi12 PenguinBoi12 deleted the fix-error-handler branch April 12, 2026 18:53
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.

2 participants