nest icon indicating copy to clipboard operation
nest copied to clipboard

Multer error fieldname

Open MegaSpaceHamlet opened this issue 1 year ago • 4 comments
trafficstars

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x ] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [x] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior?

When transforming a MulterError into a Nest error, the optional field 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?

  • [ ] Yes
  • [x] No

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.

MegaSpaceHamlet avatar Apr 08 '24 21:04 MegaSpaceHamlet

Pull Request Test Coverage Report for Build aa3c3f7d-478d-43ae-b28d-1cef4587eccd

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 92.125%

Totals Coverage Status
Change from base Build eacd3e56-4bed-4f5e-9bab-412a10335aab: 0.002%
Covered Lines: 6738
Relevant Lines: 7314

💛 - Coveralls

coveralls avatar Apr 08 '24 21:04 coveralls

What would be a better way to classify it?

MegaSpaceHamlet avatar May 01 '24 05:05 MegaSpaceHamlet

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.

benjGam avatar May 03 '24 07:05 benjGam

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.

MegaSpaceHamlet avatar May 30 '24 21:05 MegaSpaceHamlet