Skip to content

improve re error#2678

Merged
ichard26 merged 1 commit into
mainfrom
reerr
Dec 8, 2021
Merged

improve re error#2678
ichard26 merged 1 commit into
mainfrom
reerr

Conversation

@JelleZijlstra

Copy link
Copy Markdown
Collaborator

Fixes #2677

Comment thread src/black/__init__.py
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
Copy Markdown
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)

@ichard26 ichard26 left a comment

Copy link
Copy Markdown
Collaborator

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

2 participants