Skip to content

Commit c26723a

Browse files
committed
Do a 500 error if it's not a QueryError
1 parent 8c10ef8 commit c26723a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/webapp/app/routes/api.v1.query.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ const { action, loader } = createActionApiRoute(
5050
query,
5151
});
5252

53-
return json({ error: message }, { status: 400 });
53+
return json(
54+
{ error: message },
55+
{ status: queryResult.error instanceof QueryError ? 400 : 500 }
56+
);
5457
}
5558

5659
const { result, periodClipped, maxQueryPeriod } = queryResult;

0 commit comments

Comments
 (0)