Skip to content

chore(error messages): clarify reasons for refusing values #237

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jelmerdemaat
Copy link

I was working with this package via @nestjs/platform-express and I updated it from v0.5.0 to v0.7.1. After this my application login stopped working. I checked why this was, and ultimately I found out that the cookieNameRegExp check was rejecting my cookie name. This cookie name was valid before:

test::name

This wasn't valid anymore after updating. I don't know if this is correct, or if it is maybe already fixed in the most recent version of the package. That is not my issue.

What would have helped me find my issue sooner is a better error message. Looking at the existing text argument name is invalid makes it seem like the argument variable name itself is invalid. I would suggest improving the error texts like so:

Argument "name" is invalid: ${name}. It does not match the cookie name regular expression ${cookieNameRegExp}.

I have improved this in all error messages in the index.ts file.

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.

1 participant