{"record":{"id":"2be6b66ac64f92c9","repo":"badges/shields","slug":"response-error-service-error","errorCode":null,"errorMessage":"response.error || 'service error'","messagePattern":"response\\.error \\|\\| 'service error'","errorType":"exception","errorClass":"InvalidResponse","httpStatus":null,"severity":"error","filePath":"services/uptimeobserver/uptimeobserver-base.js","lineNumber":49,"sourceCode":"\n  async fetch({ monitorKey }) {\n    this.constructor.ensureIsMonitorApiKey(monitorKey)\n\n    // Docs for API: https://support.uptimeobserver.com/shields-api.yaml\n    const url = `https://app.uptimeobserver.com/api/monitor/status/${monitorKey}`\n\n    const response = await this._requestJson({\n      schema: singleMonitorResponse,\n      url,\n      options: {\n        method: 'GET',\n      },\n      logErrors: [],\n    })\n\n    // Handle error responses\n    if (response.error) {\n      throw new InvalidResponse({\n        prettyMessage: response.error || 'service error',\n      })\n    }\n\n    return response\n  }\n}\n","sourceCodeStart":31,"sourceCodeEnd":57,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/uptimeobserver/uptimeobserver-base.js#L31-L57","documentation":"The UptimeObserver base fetch() throws InvalidResponse when the upstream API response body contains an error field. The badge shows the API's own error text if present, otherwise the generic 'service error'. This indicates UptimeObserver itself rejected the request or reported a problem rather than returning monitor data.","triggerScenarios":"Any uptime-observer badge request where the parsed JSON response has a truthy error property; fetch() checks response.error after the request completes.","commonSituations":"Expired or revoked monitor API key; monitor deleted from UptimeObserver; upstream API outage or rate limiting returning an error payload.","solutions":["Read the prettyMessage for the upstream error text and act on it (usually key or monitor invalid).","Regenerate the monitor API key and update the badge URL.","Confirm the monitor still exists in your UptimeObserver account.","Retry later if the upstream service is having an outage."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const d = await fetchUptimeObserver(key, id) } catch (e) { if (e instanceof InvalidResponse) fallbackToCachedStatus(); else throw e }","preventionTips":["Rotate API keys before expiry and keep badge URLs in sync.","Monitor UptimeObserver status for upstream incidents.","Cache the last good badge data to survive transient upstream errors."],"tags":["upstream","invalid-response","api"],"backgroundTag":"upstream-service-error","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}