Skip to content

Commit

Permalink
Fix file size limit error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
FlameWolf committed Nov 18, 2024
1 parent 3999258 commit eadccec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ const formDataParser = async (instance, options) => {
});
bus.on("file", (name, stream, info) => {
stream.on("limit", () => {
done(
new Error("File size limit exceeded", {
field: name,
...info
})
);
done({
message: "File size limit exceeded",
field: name,
...info
});
});
try {
results.push(storage.process(name, stream, info));
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formzilla",
"version": "3.5.0",
"version": "3.5.1",
"description": "Fastify plugin for parsing multipart/form data",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit eadccec

Please sign in to comment.