I have a case when a transform stream throws an error in pipeline while the stream is handled by the method send of s3 client instance.
The error thrown is not caught by the try catch in the code.
I isolated the problem in a small example here: https://github.com/HalexV/throw-error-s3-upload.
The project uses a node version 18.
To run the example:
cd into the folder
nvm use
npm ci
docker compose up -d
npm start
I'm using async generators to create the readable and transform (https://nodejs.org/api/stream.html#streams-compatibility-with-async-generators-and-async-iterators).
If I change the uploadS3 to an async generator writable, the error is caught by the try catch.