Skip to content

Conversation

@Urgau
Copy link
Member

@Urgau Urgau commented Oct 25, 2025

Instead of having each user error (like UnknownLabels) be it's own error type, group all the user errors under the UserError type, which now becomes a enum.

This simplifies the handling as it means that we only have to catch one type UserError, and post a comment for it on the issue. It also avoids the need for each handler to catch all the user errors and do a manual handling (issue_handlers! and command_handlers! do that for them).

This also avoid accidentally eating the error instead of posting it to the user.

I have tested the changes on my own test repo with success.

Best reviewed commit by commit.

@Urgau Urgau requested a review from Kobzol October 25, 2025 11:20
@Urgau Urgau force-pushed the better-user-error branch from 7a6ffb3 to 87d1c44 Compare October 25, 2025 15:31
Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

Thanks! This is quite nice.

View changes since this review

@Urgau Urgau added this pull request to the merge queue Oct 25, 2025
Merged via the queue into rust-lang:master with commit c6b8549 Oct 25, 2025
3 checks passed
@Urgau Urgau deleted the better-user-error branch October 25, 2025 16:19
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