From 8054998fdc4c82dbc936f9b810d74cf5b8d83f60 Mon Sep 17 00:00:00 2001 From: Heng Qian Date: Thu, 10 Oct 2024 15:52:02 +0800 Subject: [PATCH] Address comments Signed-off-by: Heng Qian --- server/routes/summary_routes.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/routes/summary_routes.ts b/server/routes/summary_routes.ts index 45eb3110..4300246c 100644 --- a/server/routes/summary_routes.ts +++ b/server/routes/summary_routes.ts @@ -74,7 +74,7 @@ export function registerSummaryAssistantRoutes( summary = response.body.inference_results[0].output[0].result; return res.ok({ body: { summary, insightAgentIdExists } }); } catch (e) { - return res.internalError(); + return res.badRequest({ body: e }); } }) ); @@ -113,7 +113,7 @@ export function registerSummaryAssistantRoutes( try { return res.ok({ body: response.body.inference_results[0].output[0].result }); } catch (e) { - return res.internalError(); + return res.badRequest({ body: e }); } }) ); @@ -131,6 +131,7 @@ function detectInsightAgentId( } else if (insightType === 'user_insight' && summaryType === 'alerts') { return searchAgent({ name: 'KB_For_Alert_Insight' }, client); } + return undefined; } export function registerData2SummaryRoutes( @@ -169,7 +170,7 @@ export function registerData2SummaryRoutes( const result = response.body.inference_results[0].output[0].result; return res.ok({ body: result }); } catch (e) { - return res.internalError(); + return res.badRequest({ body: e }); } }) );