In make-middleware.js, creating a new Busboy is wrapped in a try/catch. However, those errors are passed straight to next, which makes them hard to operate on. For example, Busboy throws an error immediately if the multipart boundary is missing. I'd like to turn this into a 4xx error, but right now it's a 5xx, since we can't do instanceof MulterError. It would be great if these errors were wrapped in a MulterError. In fact, I think that is maybe the only error that Busboy throws during init, in which case it could even get its own error code.
In make-middleware.js, creating a new Busboy is wrapped in a try/catch. However, those errors are passed straight to
next
, which makes them hard to operate on. For example, Busboy throws an error immediately if the multipart boundary is missing. I'd like to turn this into a 4xx error, but right now it's a 5xx, since we can't doinstanceof MulterError
. It would be great if these errors were wrapped in aMulterError
. In fact, I think that is maybe the only error that Busboy throws during init, in which case it could even get its own error code.