rwf2 / multer

An async parser for multipart/form-data content-type in Rust
MIT License
156 stars 35 forks source link

Prevent accidental double-boxing of `StreamReadFailed` errors #55

Closed SabrinaJewson closed 1 year ago

SabrinaJewson commented 1 year ago

Since the inner stream already wraps the error in StreamReadFailed, there’s no need to do it again.

SergioBenitez commented 1 year ago

Not to suggest that we shouldn't fix this (I agree the way it's been implemented is pretty funky), but I want to note that this isn't quite doing the same thing as before. Before we would get something like StreamReadFailed(StreamSizeExceeded) whereas with this we would only get StreamSizeExceeded. This seems better to me, but it might (?) be a breaking change.

SergioBenitez commented 1 year ago

Merged in https://github.com/rousan/multer-rs/commit/3940c4a09724b84debcac9694b7666450fa25123. Thank you!