Skip to content

Commit

Permalink
throw the full error from the translate function
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtraction committed Oct 9, 2021
1 parent 46e06ba commit 2ab9d84
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ async function translate(text, options) {
return result;
}
catch (e) {
if (e.name === "HTTPError") {
let error = new Error();
error.name = e.name;
error.statusCode = e.statusCode;
error.statusMessage = e.statusMessage;
throw error;
}
throw e;
}
}
Expand Down

0 comments on commit 2ab9d84

Please sign in to comment.