Skip to content

Commit

Permalink
Modified src/oauth2.js to replace optional chaining with a conditiona…
Browse files Browse the repository at this point in the history
…l ternary operator for errorStatus and errorMessage variables.
  • Loading branch information
caputomarcos committed Sep 17, 2023
1 parent 398b336 commit 4f0093f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ module.exports = function (RED) {
const { response, code, message } = error;

msg[node.container] = response || {};
const errorStatus = response?.status || code;
const errorMessage = response?.statusText || message;
const errorStatus = response && response.status ? response.status : code;
const errorMessage = response && response.statusText ? response.statusText : message;
const statusText = `HTTP ${errorStatus}, ${errorMessage}`;

setStatus(node, 'red', statusText);
Expand Down

0 comments on commit 4f0093f

Please sign in to comment.