Formidable: Now return 400 BadRequest HttpError instead of generic error.
Some checks failed
continuous-integration/appveyor/branch AppVeyor build failed
Some checks failed
continuous-integration/appveyor/branch AppVeyor build failed
This commit is contained in:
parent
2b69013c04
commit
74771d92cf
2 changed files with 2 additions and 2 deletions
|
@ -237,7 +237,7 @@ export function FormidableHandler(formidable, org = {}) {
|
||||||
|
|
||||||
return new Promise(function(res, rej) {
|
return new Promise(function(res, rej) {
|
||||||
form.parse(ctx.req, function(err, fields, files) {
|
form.parse(ctx.req, function(err, fields, files) {
|
||||||
if (err) return rej(err)
|
if (err) return rej(new HttpError(400, err.message))
|
||||||
|
|
||||||
if (opts.parseFields) {
|
if (opts.parseFields) {
|
||||||
Object.keys(fields).forEach(function(key) {
|
Object.keys(fields).forEach(function(key) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "flaska",
|
"name": "flaska",
|
||||||
"version": "1.3.1",
|
"version": "1.3.2",
|
||||||
"description": "Flaska is a micro web-framework for node. It is designed to be fast, simple and lightweight, and is distributed as a single file module with no dependencies.",
|
"description": "Flaska is a micro web-framework for node. It is designed to be fast, simple and lightweight, and is distributed as a single file module with no dependencies.",
|
||||||
"main": "flaska.mjs",
|
"main": "flaska.mjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in a new issue