Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve re error #2678

Merged
merged 1 commit into from Dec 8, 2021
Merged

improve re error #2678

merged 1 commit into from Dec 8, 2021

Conversation

JelleZijlstra
Copy link
Collaborator

Fixes #2677

except re.error:
raise click.BadParameter("Not a valid regular expression") from None
except re.error as e:
raise click.BadParameter(f"Not a valid regular expression: {e}") from None
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Example output:

Error: Invalid value for '--exclude': Not a valid regular expression: bad escape \e at position 71 (line 7, column 5)

Copy link
Collaborator

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

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

Wheee thank you!

@ichard26 ichard26 merged commit e7ddf52 into main Dec 8, 2021
@ichard26 ichard26 deleted the reerr branch December 8, 2021 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.

Bug on regular expression with black-21.12b0
2 participants