Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(scores/trpc): byid on deleted score resulted in 5xx error instead of 404 (#6384)

David Alexander Pfeifferf5aec02277ab
diff --git a/web/src/server/api/routers/scores.ts b/web/src/server/api/routers/scores.ts
index d4385e491b..374598b71c 100644
--- a/web/src/server/api/routers/scores.ts
+++ b/web/src/server/api/routers/scores.ts
@@ -142,9 +142,10 @@ export const scoresRouter = createTRPCRouter({
.query(async ({ input }) => {
const score = await getScoreById(input.projectId, input.scoreId);
if (!score) {
- throw new LangfuseNotFoundError(
- `No score with id ${input.scoreId} in project ${input.projectId} in Clickhouse`,
- );
+ throw new TRPCError({
+ code: "NOT_FOUND",
+ message: `No score with id ${input.scoreId} in project ${input.projectId} in Clickhouse`,
+ });
}
return score;
}),