diff --git a/lib/api/api.js b/lib/api/api.js index e34ab54ec9..91451b460a 100644 --- a/lib/api/api.js +++ b/lib/api/api.js @@ -227,8 +227,10 @@ const api = { if ('key' in request.formData) { return next(null); } - return next(errors.InvalidArgument.customizeDescription('Bucket POST must contain' - + " a field named 'key'. If it is specified, please check the order of the fields.")); + + const err = errors.InvalidArgument.customizeDescription('Bucket POST must contain' + + " a field named 'key'. If it is specified, please check the order of the fields."); + formDataParser.emit('error', err); }); formDataParser.on('finish', () => { // No file field == error