Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Heng Qian <[email protected]>
  • Loading branch information
qianheng-aws committed Oct 10, 2024
1 parent b7cefcf commit 8054998
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/routes/summary_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
})
);
Expand Down Expand Up @@ -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 });
}
})
);
Expand All @@ -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(
Expand Down Expand Up @@ -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 });
}
})
);
Expand Down

0 comments on commit 8054998

Please sign in to comment.