feat: add LOG_LEVEL env var and improve error messages

Add configurable LOG_LEVEL (fatal/error/warn/info/debug/trace) for
Fastify logger. Always return error details in tool processing
responses and combine error + details in frontend display.
This commit is contained in:
Siddharth Kumar Sah
2026-04-11 14:47:30 +08:00
parent f2696443dc
commit 6c1a347f1c
5 changed files with 12 additions and 5 deletions
+7 -2
View File
@@ -186,7 +186,10 @@ export function useToolProcessor(toolId: string) {
} else {
try {
const body = JSON.parse(xhr.responseText);
setError(body.error || body.details || `Processing failed: ${xhr.status}`);
const msg = body.details
? `${body.error}: ${body.details}`
: body.error || `Processing failed: ${xhr.status}`;
setError(msg);
} catch {
setError(`Processing failed: ${xhr.status}`);
}
@@ -305,7 +308,9 @@ export function useToolProcessor(toolId: string) {
let errorMsg: string;
try {
const body = JSON.parse(text);
errorMsg = body.error || body.details || `Batch processing failed: ${response.status}`;
errorMsg = body.details
? `${body.error}: ${body.details}`
: body.error || `Batch processing failed: ${response.status}`;
} catch {
errorMsg = `Batch processing failed: ${response.status}`;
}