Observed
Non-XML response bodies are parsed as XML, resulting in an anonymous error.
Expected
It would be helpful if the resulting error included:
- http status code
- response headers
- response body
Environment
Tested with:
Repro
const express = require('express');
const app = express();
app.all('/*', (req, res) => res.sendStatus(502));
(async () => {
const port = await new Promise(resolve => {
const server = app.listen(0, () => resolve(server.address().port));
});
const Minio = require('minio');
const minioClient = new Minio.Client({ endPoint:`localhost`, port, useSSL:false });
try {
await minioClient.getObject('abfg', 'b');
} catch(err) {
console.log(err);
_err = err;
}
})();
The resulting error looks like:
{
name: 'S3Error',
amzBucketRegion: undefined,
amzId2: undefined,
amzRequestid: undefined,
}
with stack:
S3Error
at parseError (node_modules/minio/dist/main/internal/xml-parser.js:58:13)
at Object.parseResponseError (node_modules/minio/dist/main/internal/xml-parser.js:105:11)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async Client.makeRequestStreamAsync (node_modules/minio/dist/main/internal/client.js:514:19)
at async Client.getBucketRegionAsync (node_modules/minio/dist/main/internal/client.js:564:19)
at async Client.makeRequestStreamAsync (node_modules/minio/dist/main/internal/client.js:485:25)
at async Client.getPartialObject (node_modules/minio/dist/main/internal/client.js:842:12)
at async REPL19:10:5
Observed
Non-XML response bodies are parsed as XML, resulting in an anonymous error.
Expected
It would be helpful if the resulting error included:
Environment
Tested with:
Repro
The resulting error looks like:
with stack: