Closed prpanto closed 1 year ago
I try to catch the error with try/catch and have an error...
ERROR [h3] [unhandled] write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
try {
const { files, fields } = await readFiles(event, {
includeFields: true,
maxFiles: 1,
maxFileSize: fileSize,
});
} catch (error) {
if (error.code === formidableErrors.maxFilesExceeded) {
throw createError({
statusCode: 422,
message: 'Can\'t upload more than one image.'
});
}
if (error.code === formidableErrors.biggerThanTotalMaxFileSize) {
throw createError({
statusCode: 422,
message: `The file(s) is larger than ${(fileSize / (1024 * 1024))}MB.`
});
}
}
Hi! Please upgrade to v1 and check if you get the expected error.
There is a breaking change - https://github.com/wobsoriano/h3-formidable/pull/11
Feel free to reopen!
I dont know how to get the error for example I set a size limit and I dont know how to get the error...
I expecting something like: