Skip to content

Commit 5424b88

Browse files
authored
Merge pull request #2209 from Urgau/commands-user-error
Post a user message when a command processing fails
2 parents 1340bf1 + cfdb6d5 commit 5424b88

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/handlers.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@ macro_rules! command_handlers {
422422
if let Some(err) = err.downcast_mut::<UserError>() {
423423
errors.push(HandlerError::Message(std::mem::take(&mut err.0)));
424424
} else {
425+
errors.push(HandlerError::Message(format!(
426+
"`{}` handler unexpectedly failed in [this comment]({}): {err}",
427+
stringify!($name),
428+
event.html_url().expect("has html url"),
429+
)));
425430
errors.push(HandlerError::Other(err.context(format!(
426431
"error when processing {} command handler",
427432
stringify!($name)

0 commit comments

Comments
 (0)