From a4907e0cee44e9afed18744c88c2518c2ea30310 Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:49:10 -0400 Subject: [PATCH] Show the underlying cause when Seafile is unreachable Co-Authored-By: Claude Sonnet 5.5 --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 5dcd837..72c50f5 100644 --- a/server.js +++ b/server.js @@ -51,7 +51,9 @@ async function proxySeafile(req, res) { if (upstream.body) Readable.fromWeb(upstream.body).pipe(res); else res.end(); } catch (e) { 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 + ')' : '') })); } }