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

Fixing uncaught exception when using limitError #1600

Merged
merged 9 commits into from
Mar 2, 2024

Conversation

RobinTail
Copy link
Owner

The limitHandler of express-fileupload called asynchronously for a failed file before finishing the upload.
In the end express-fileupload calls next().
All that leads to calling next() multiple times which leads to uncaught exception due to the way the error handling in express is organised.
The next() must be called once after completing the file processing.

@RobinTail RobinTail added refactoring The better way to achieve the same result prevention labels Mar 2, 2024
@RobinTail RobinTail marked this pull request as ready for review March 2, 2024 10:55
src/server.ts Show resolved Hide resolved
@RobinTail RobinTail force-pushed the fix-uncaught-when-limit-error branch from 7594269 to 9c3614e Compare March 2, 2024 11:23
Copy link
Owner Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@RobinTail RobinTail merged commit 2d08bbc into master Mar 2, 2024
11 checks passed
@RobinTail RobinTail deleted the fix-uncaught-when-limit-error branch March 2, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevention refactoring The better way to achieve the same result
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant