{"record":{"id":"526cbf6c56df17a1","repo":"koala73/worldmonitor","slug":"server-error-status","errorCode":null,"errorMessage":"Server error: {{status}}","messagePattern":"Server error: (.+?)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/components/WidgetChatModal.ts","lineNumber":317,"sourceCode":"\n      const res = await fetch(widgetAgentUrl(), {\n        method: 'POST',\n        signal: abortController.signal,\n        headers: reqHeaders,\n        body,\n      });\n\n      if (!res.ok) {\n        let payload: WidgetAgentHealth | null = null;\n        try { payload = await res.json() as WidgetAgentHealth; } catch { /* ignore */ }\n        reportWidgetEntitlementDesync(\n          res.status,\n          payload,\n          auth.usedTesterKey,\n          requestBelief,\n          requestUserId,\n        );\n        throw new Error(t('widgets.serverError', { status: res.status }));\n      }\n      if (!res.body) {\n        throw new Error(t('widgets.serverError', { status: res.status }));\n      }\n\n      let resultHtml = '';\n      let resultTitle = existing?.title ?? 'Custom Widget';\n      let toolBadgeEl: HTMLElement | null = null;\n      const statusEl = appendMessage(messagesEl, 'assistant', '');\n      const radarEl = document.createElement('span');\n      radarEl.className = 'widget-chat-radar';\n      setTrustedHtml(radarEl, trustedHtml('<span class=\"panel-loading-radar\"><span class=\"panel-radar-sweep\"></span><span class=\"panel-radar-dot\"></span></span>', \"legacy direct innerHTML migration\"));\n      statusEl.appendChild(radarEl);\n\n      const reader = res.body.getReader();\n      const decoder = new TextDecoder();\n      let buf = '';\n","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/src/components/WidgetChatModal.ts#L299-L335","documentation":"UI error in WidgetChatModal.submit: the widget-agent fetch returned a non-OK HTTP status. The response body is parsed as WidgetAgentHealth and passed to reportWidgetEntitlementDesync to detect tester-key/entitlement mismatches before the localized 'Server error' message is thrown with the status code.","triggerScenarios":"Thrown at src/components/WidgetChatModal.ts:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request — transient 5xx from the widget agent usually resolve","Check the status: 401/403 suggests auth or entitlement problems, 429 suggests rate limiting — wait and retry","If it persists, verify the widget agent deployment is healthy"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}