Skip to content

Commit

Permalink
Check typeof json.error for Uptime Robot
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Apr 19, 2017
1 parent 7a3c558 commit 91f69ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6060,8 +6060,8 @@ cache(function(data, match, sendBadge, request) {
}
try {
if (json.stat === 'fail') {
badgeData.text[1] = 'unknown error';
if (json.error) {
badgeData.text[1] = 'vendor error';
if (json.error && typeof json.error.message === 'string') {
badgeData.text[1] = json.error.message;
}
badgeData.colorscheme = 'lightgrey';
Expand Down Expand Up @@ -6128,8 +6128,8 @@ cache(function(data, match, sendBadge, request) {
}
try {
if (json.stat === 'fail') {
badgeData.text[1] = 'unknown error';
if (json.error) {
badgeData.text[1] = 'vendor error';
if (json.error && typeof json.error.message === 'string') {
badgeData.text[1] = json.error.message;
}
badgeData.colorscheme = 'lightgrey';
Expand Down

0 comments on commit 91f69ae

Please sign in to comment.