diff --git a/index.js b/index.js index f2a6d78..78cf7a6 100644 --- a/index.js +++ b/index.js @@ -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)); diff --git a/package-lock.json b/package-lock.json index 991799c..8fb40cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "formzilla", - "version": "3.5.0", + "version": "3.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "formzilla", - "version": "3.5.0", + "version": "3.5.1", "license": "ISC", "dependencies": { "busboy": "^1.6.0" diff --git a/package.json b/package.json index f534cee..2a5d348 100644 --- a/package.json +++ b/package.json @@ -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": {