minio-js icon indicating copy to clipboard operation
minio-js copied to clipboard

Rethrow exceptions other than InvalidBucketNameError

Open iyxan23 opened this issue 1 year ago • 0 comments

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.

iyxan23 avatar Aug 29 '24 04:08 iyxan23