Show the underlying cause when Seafile is unreachable
build-container / build (push) Successful in 2m25s
build-container / build (push) Successful in 2m25s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34a8d28059
commit
a4907e0cee
1 file changed
+3
-1
@@ -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 + ')' : '') }));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user