Closed potravniy closed 4 years ago
Yes, it would be good to catch the error in the callback function.
Looks like the parent formidable repo fixed this issue recently: https://github.com/node-formidable/node-formidable/commit/c8bba1b1d661f198c477d1ec64bc31efbba194a3#diff-38e857ca3aca5cc608230f4e8d0b3ea5
I will push an update soon.
Published updated version (v1.0.3) to npm.
I like formidable-serverless, it really solved my pain with Firebase functions. It is used as following:
Having sent an empty request without any field and file the unhandled error happened:
"Unhandled" means that error was not cought with neither
if (err) reject(err);
norif (Object.keys(fields).length === 0) reject(new Error("No data to upload."));
It would be good to catch this error in
callback
function aserr
.Thank you!