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 error message when parsing fails #336

Open
simhnna opened this issue Oct 17, 2024 · 1 comment
Open

Improve error message when parsing fails #336

simhnna opened this issue Oct 17, 2024 · 1 comment

Comments

@simhnna
Copy link

simhnna commented Oct 17, 2024

I got error messages like TypeError: Missing parameter name at 3: https://git.new/pathToRegexpError and I was wondering how that weird url made it's way into my code

Two suggestions:

  1. It doeesn't look like lexer() gets the whole error, so maybe it would be good to wrap those errors in parse() and include the whole string?
  2. Make it clear that the url is documentation. Something like For more information about regexp paths check https://...
  3. I personally would prefer a link that clearly shows it's going to github instead of a link shortener, but that's just my opinion

If you're ok with me changing 1 and 2, I'm happy to prepare a pull request

@blakeembrey
Copy link
Member

  1. I'm not sure I understand, can you elaborate on what "the whole string"?
  2. Sounds good, I'm open to a PR that changes it to something like ...; visit <link> for more information.
  3. Prefer to avoid changing for now, it's there to ensure the error docs can move or update in the future without breaking old versions of the library.

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

No branches or pull requests

3 participants