koala73/worldmonitor · error
Internal server error
Error message
Internal server error
What it means
Generic 500 JSON response emitted by the sidecar's top-level request handler catch block when any handler throws unexpectedly. The real error is logged as '[local-api] fatal' and recorded in the traffic log with its message; the wire body deliberately reveals only 'Internal server error' plus CORS headers.
Source
Thrown at src-tauri/sidecar/local-api-server.mjs:1899
res.writeHead(response.status, headers);
res.end(body);
} catch (error) {
const durationMs = Date.now() - start;
context.logger.error('[local-api] fatal', error);
if (!skipRecord) {
recordTraffic({
timestamp: new Date().toISOString(),
method: req.method,
path: requestUrl.pathname + (requestUrl.search || ''),
status: 500,
durationMs,
error: error.message,
});
}
res.writeHead(500, { 'content-type': 'application/json', ...makeCorsHeaders(req) });
res.end(JSON.stringify({ error: 'Internal server error' }));
}
});
return {
context,
routes,
server,
async start() {
const tryListen = (port) => new Promise((resolve, reject) => {
const onListening = () => { server.off('error', onError); resolve(); };
const onError = (error) => { server.off('listening', onListening); reject(error); };
server.once('listening', onListening);
server.once('error', onError);
server.listen(port, '127.0.0.1');
});
try {View on GitHub (pinned to 9361220cc0)
Solutions
- Inspect the sidecar log for the '[local-api] fatal' entry to identify the underlying exception
- Check the traffic record's error field for the captured message
- Fix the route handler that threw; the 500 itself is only a symptom
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src-tauri/sidecar/local-api-server.mjs:1891 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
AI-assisted analysis of koala73/worldmonitor@9361220cc0 (2026-08-21).
Data as JSON: /api/errors/ae37233f271f7f2c.
Report an issue: GitHub.