Skip to content

Commit b4f878d

Browse files
author
Will Toozs
committed
fixup: emit error on key missing instead of next
1 parent 7033c44 commit b4f878d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/api/api.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,10 @@ const api = {
227227
if ('key' in request.formData) {
228228
return next(null);
229229
}
230-
return next(errors.InvalidArgument.customizeDescription('Bucket POST must contain'
231-
+ " a field named 'key'. If it is specified, please check the order of the fields."));
230+
231+
const err = errors.InvalidArgument.customizeDescription('Bucket POST must contain'
232+
+ " a field named 'key'. If it is specified, please check the order of the fields.");
233+
formDataParser.emit('error', err);
232234
});
233235
formDataParser.on('finish', () => {
234236
// No file field == error

0 commit comments

Comments
 (0)