You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer the following questions for yourself before submitting an issue.
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
I'm reporting the issue to the correct repository
Current Behavior
If a fileSize limit is specified in a multpart upload route, then upon reaching the limit an unhandled PayloadTooLarge error is thrown & the process crashes. API gateway error handlers don't catch this error.
busboy allows you to define onFileSizeLimit handler, however I haven't found a way to prevent the error from being thrown (it's thrown on the next line after the handler call).
Expected Behavior
Route or global error handler should handle the error. If no error handlers are defined, the default error handler should handle the error.
Or onFileSizeLimit handler should provide a way (specified in documentation) to cancel throwing unhandled error.
The process shouldn't crash.
I can submit a PR with the fix, especially if given advice on how to refactor it best.
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Moleculer version: 0.14.28
Moleculer-web versio: 0.10.5
NodeJS version: 16.19.0
Failure Logs
node:events:491
throw er; // Unhandled 'error' event
^
PayloadTooLarge: Payload too large
at FileStream.<anonymous> (node_modules/moleculer-web/src/alias.js:161:18)
at FileStream.emit (node:events:513:28)
at PartStream.onData (node_modules/@fastify/busboy/lib/types/multipart.js:205:18)
at PartStream.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at PartStream.Readable.push (node:internal/streams/readable:228:10)
at Dicer._oninfo (node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:162:36)
at Dicer._oninfo (node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:167:65)
at SBMH.<anonymous> (node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:108:10)
Emitted 'error' event on FileStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 413,
type: 'PAYLOAD_TOO_LARGE',
data: {
fieldname: 'file',
filename: 'test.csv',
encoding: '7bit',
mimetype: 'text/csv'
},
retryable: false
}
The text was updated successfully, but these errors were encountered:
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
If a fileSize limit is specified in a multpart upload route, then upon reaching the limit an unhandled PayloadTooLarge error is thrown & the process crashes. API gateway error handlers don't catch this error.
busboy allows you to define
onFileSizeLimit
handler, however I haven't found a way to prevent the error from being thrown (it's thrown on the next line after the handler call).Expected Behavior
Route or global error handler should handle the error. If no error handlers are defined, the default error handler should handle the error.
Or
onFileSizeLimit
handler should provide a way (specified in documentation) to cancel throwing unhandled error.The process shouldn't crash.
I can submit a PR with the fix, especially if given advice on how to refactor it best.
Failure Information
Error is thrown here
Reproduce code snippet
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
0.14.28
0.10.5
16.19.0
Failure Logs
The text was updated successfully, but these errors were encountered: