Show the underlying cause when Seafile is unreachable
build-container / build (push) Successful in 2m25s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-20 13:49:10 -04:00
1 parent 34a8d28059
commit a4907e0cee
1 file changed
+3 -1
+3 -1
View File
@@ -51,7 +51,9 @@ async function proxySeafile(req, res) {
if (upstream.body) Readable.fromWeb(upstream.body).pipe(res); else res.end(); if (upstream.body) Readable.fromWeb(upstream.body).pipe(res); else res.end();
} catch (e) { } catch (e) {
res.writeHead(502, { 'content-type': 'application/json' }); res.writeHead(502, { 'content-type': 'application/json' });
res.end(JSON.stringify({ error: 'Seafile unreachable: ' + e.message })); const why = e.cause ? (e.cause.code || e.cause.message) : '';
console.error('Seafile proxy:', target.split('?')[0], e.message, why);
res.end(JSON.stringify({ error: 'Seafile unreachable: ' + e.message + (why ? ' (' + why + ')' : '') }));
} }
} }