Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Update ThundraWrapper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
hamitb committed Feb 25, 2020
1 parent 10b9d78 commit a3dbdfa
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/ThundraWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,20 @@ class ThundraWrapper {
return resolve(false);
}

let errMessage: string;
if (typeof mes === 'string') {
const match = mes.match(BROKER_WS_HTTP_ERROR_PATTERN);

if (match) {
const errCode = Number(match[1]);
const errMessage = BROKER_WS_HTTP_ERR_CODE_TO_MSG[errCode];

if (errMessage) {
ThundraLogger.getInstance().error('Thundra Debugger: ' + errMessage);
}
errMessage = BROKER_WS_HTTP_ERR_CODE_TO_MSG[errCode];
}
}

// If errMessage is undefined replace it with the raw incoming message
errMessage = errMessage || mes;
ThundraLogger.getInstance().error('Thundra Debugger: ' + errMessage);

return resolve(true);
});
});
Expand Down

0 comments on commit a3dbdfa

Please sign in to comment.