Skip to content

Commit

Permalink
🐛 FIX: try to use result code first
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 9, 2022
1 parent b87c8c1 commit fc2fb8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ proto.requestError = async function requestError(result) {
err = new Error(result.message);
err.name = result.name;
err.status = result.status;
err.code = result.name;
// try to use raw code first
err.code = result.code || result.name;
} else {
// HEAD not exists resource
if (result.status === 404) {
Expand Down
1 change: 0 additions & 1 deletion lib/sts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const is = require('is-type-of');
const ms = require('humanize-ms');
const urllib = require('urllib');


function STS(options) {
if (!(this instanceof STS)) {
return new STS(options);
Expand Down

0 comments on commit fc2fb8f

Please sign in to comment.