Skip to content

Add context=True parameter to registry error() for command error handlers#43

Merged
PenguinBoi12 merged 1 commit intomainfrom
error-wrapper-handle-context
Apr 17, 2026
Merged

Add context=True parameter to registry error() for command error handlers#43
PenguinBoi12 merged 1 commit intomainfrom
error-wrapper-handle-context

Conversation

@PenguinBoi12
Copy link
Copy Markdown
Contributor

Added context=True parameter to registry error() to support command-specific error handlers that receive the command context alongside the error. When context=True, the handler is registered in _command_error_handlers and called with (ctx, error), allowing replies and other context-aware operations. Requires a specific exception type — fallback command error handling should use the on_command_error lifecycle hook instead.

@PenguinBoi12 PenguinBoi12 changed the title Add context=True parameter to registry error() for command error handlers draft: Add context=True parameter to registry error() for command error handlers Apr 12, 2026
@PenguinBoi12 PenguinBoi12 changed the title draft: Add context=True parameter to registry error() for command error handlers Draft: Add context=True parameter to registry error() for command error handlers Apr 12, 2026
@PenguinBoi12 PenguinBoi12 force-pushed the error-wrapper-handle-context branch 6 times, most recently from 0d82ceb to 4a312b7 Compare April 12, 2026 08:54
@PenguinBoi12 PenguinBoi12 marked this pull request as draft April 12, 2026 09:04
@PenguinBoi12 PenguinBoi12 force-pushed the error-wrapper-handle-context branch from 4a312b7 to 0986da6 Compare April 16, 2026 23:58
@PenguinBoi12 PenguinBoi12 marked this pull request as ready for review April 16, 2026 23:58
@PenguinBoi12 PenguinBoi12 force-pushed the error-wrapper-handle-context branch from 0986da6 to 5579760 Compare April 17, 2026 00:13
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.

Nice work. LGTM

@PenguinBoi12 PenguinBoi12 changed the title Draft: Add context=True parameter to registry error() for command error handlers Add context=True parameter to registry error() for command error handlers Apr 17, 2026
@PenguinBoi12 PenguinBoi12 merged commit a4179c2 into main Apr 17, 2026
4 checks passed
@PenguinBoi12 PenguinBoi12 deleted the error-wrapper-handle-context branch April 17, 2026 00:27
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