{"record":{"id":"c692e829e155c553","repo":"badges/shields","slug":"service-error","errorCode":null,"errorMessage":"service error","messagePattern":"service error","errorType":"exception","errorClass":"InvalidResponse","httpStatus":null,"severity":"error","filePath":"services/uptimerobot/uptimerobot-base.js","lineNumber":82,"sourceCode":"      url: 'https://api.uptimerobot.com/v2/getMonitors',\n      options: {\n        method: 'POST',\n        headers: {\n          'cache-control': 'no-cache',\n          'content-type': 'application/x-www-form-urlencoded',\n        },\n        form: {\n          api_key: monitorSpecificKey,\n          format: 'json',\n          ...opts,\n        },\n      },\n      logErrors: [],\n    })\n\n    if (stat === 'fail') {\n      const { message } = error\n      throw new InvalidResponse({ prettyMessage: message || 'service error' })\n    }\n\n    return { monitors }\n  }\n}\n","sourceCodeStart":64,"sourceCodeEnd":88,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/uptimerobot/uptimerobot-base.js#L64-L88","documentation":"UptimeRobot's fetch() throws InvalidResponse when the upstream API responds with stat === 'fail', surfacing the API's error message, or the fallback 'service error' when message is absent. UptimeRobot signals failures this way with HTTP 200, so the badge must translate the body-level failure into an error state.","triggerScenarios":"Any uptimerobot badge request where the response body has stat='fail' — e.g. invalid monitorSpecificKey, monitor not found, or API limits/errors — with the error object's message forwarded when available.","commonSituations":"Wrong or revoked monitor API key; monitor deleted; exceeding UptimeRobot API rate limits; UptimeRobot-side API incidents.","solutions":["Check the rendered error text (the forwarded API message) for the specific cause.","Regenerate and reinstall a monitor-specific API key starting with 'm'.","Confirm the monitor still exists in UptimeRobot.","Wait and retry if you are being rate limited or UptimeRobot is degraded."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const { monitors } = await fetchUptimeRobot(key, days) } catch (e) { if (e instanceof InvalidResponse) log.warn('UptimeRobot API failed:', e.prettyMessage); throw e }","preventionTips":["Verify the monitor-specific key periodically; regenerate on revocation.","Respect UptimeRobot API rate limits to avoid stat=fail responses.","Subscribe to UptimeRobot status updates to anticipate outages."],"tags":["upstream","invalid-response","api"],"backgroundTag":"upstream-api-error","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}