-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Multer error fieldname #13407
base: master
Are you sure you want to change the base?
Multer error fieldname #13407
Conversation
Multer errors may include a 'field' property for certain errors. Pass it along into the error message.
Add the possible `field` property to the `error` arg in `transformExecption`.
Pull Request Test Coverage Report for Build aa3c3f7d-478d-43ae-b28d-1cef4587eccdDetails
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look as a "refactor" change.
What would be a better way to classify it? |
I would personally classify it as a "Bugfix" or "Feature" determining it on the base of the first idea with which this system was developed But here, i'm not able to tell if you fixed a bug or implement a new feature, so i can't tell. But i have the feeling that do not match "Refactor" criteria. |
Yes, I think I would categorize it as a fix. Multer provides the fieldname of the file if an error occurs, but this package does not pass it along. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When transforming a
MulterError
into a Nest error, the optionalfield
property is dropped.Issue Number: N/A
What is the new behavior?
The
field
property is included in the error message, if applicable.Does this PR introduce a breaking change?
Other information
If Multer throws an error, some identifying information is hidden from the error message.
https://github.com/expressjs/multer/blob/aa42bea6ac7d0cb8fcb279b15a7278cda805dc63/lib/multer-error.js#L19. This is where Multer adds the optional
field
property.