Skip to content

Commit

Permalink
fix: add missing error (#794)
Browse files Browse the repository at this point in the history
* fix: add missing error

* refactor: be more explicit about object signature

* docs: changelog
  • Loading branch information
GrosSacASac committed Nov 30, 2021
1 parent 1b27107 commit 5706c14
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 3.1.4

* fix: add missing pluginFailed error ([#794](https://github.com/node-formidable/formidable/pull/794))
* refactor: use explicit node imports (#786)

### 3.1.1

* feat: handle top level json array, string and number
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formidable",
"version": "3.1.3",
"version": "3.1.4",
"license": "MIT",
"description": "A node.js module for parsing form data, especially file uploads.",
"homepage": "https://github.com/node-formidable/formidable",
Expand Down
5 changes: 4 additions & 1 deletion src/Formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ const DEFAULT_OPTIONS = {
enabledPlugins: [octetstream, querystring, multipart, json],
fileWriteStreamHandler: null,
defaultInvalidName: 'invalid-name',
filter() {
filter(_part) {
return true;
},
filename: undefined,
};

function hasOwnProp(obj, key) {
Expand Down Expand Up @@ -88,6 +89,8 @@ class IncomingForm extends EventEmitter {
});

this._setUpMaxFields();
this.ended = undefined;
this.type = undefined;
}

use(plugin) {
Expand Down
2 changes: 2 additions & 0 deletions src/FormidableError.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const missingContentType = 1011;
const malformedMultipart = 1012;
const missingMultipartBoundary = 1013;
const unknownTransferEncoding = 1014;
const pluginFailed = 1017;

const FormidableError = class extends Error {
constructor(message, internalCode, httpCode = 500) {
Expand All @@ -38,6 +39,7 @@ export {
malformedMultipart,
missingMultipartBoundary,
unknownTransferEncoding,
pluginFailed,
};

export default FormidableError;

0 comments on commit 5706c14

Please sign in to comment.