minio-js
minio-js copied to clipboard
Rethrow exceptions other than InvalidBucketNameError
I had an issue where this minio client throws a InvalidArgumentError: Unable to get bucket region for ... error when trying to retrieve a presigned url. I was so confused as to why would I need to configure bucket regions for minio because I'm running it locally on as a docker container.
I modified the source to console.error the error and it appears like the original error was actually an ECONNREFUSED, masked behind the incorrect InvalidArgumentError because of the large try-catch statement.
In this PR, I made it so that it would only throw InvalidArgumentError only when the originating error is an InvalidBucketNameError, and rethrow any other error.