Skip to content

Commit 86df8ea

Browse files
d-csclaude
andcommitted
chore(webapp): downgrade SVE/OOE logs in api.v3.batches to warn
Customer-facing 422 paths now log at warn; only the 500 fall-through escalates to Sentry. Rate-limit (BatchProcessingError 429) branch above is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 82ac928 commit 86df8ea

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

apps/webapp/app/routes/api.v3.batches.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,26 @@ const { action, loader } = createActionApiRoute(
172172
);
173173
}
174174

175+
// Customer-facing validation/quota failures (invalid batch shape,
176+
// entitlements exhausted). The handler returns 422 with the message;
177+
// system handles it gracefully, no alert needed.
178+
if (error instanceof ServiceValidationError) {
179+
logger.warn("Create batch error", { error: error.message });
180+
return json({ error: error.message }, { status: 422 });
181+
}
182+
if (error instanceof OutOfEntitlementError) {
183+
logger.warn("Create batch error", { error: error.message });
184+
return json({ error: error.message }, { status: 422 });
185+
}
186+
175187
logger.error("Create batch error", {
176188
error: {
177189
message: (error as Error).message,
178190
stack: (error as Error).stack,
179191
},
180192
});
181193

182-
if (error instanceof ServiceValidationError) {
183-
return json({ error: error.message }, { status: 422 });
184-
} else if (error instanceof OutOfEntitlementError) {
185-
return json({ error: error.message }, { status: 422 });
186-
} else if (error instanceof Error) {
194+
if (error instanceof Error) {
187195
return json(
188196
{ error: error.message },
189197
{ status: 500, headers: { "x-should-retry": "false" } }

0 commit comments

Comments
 (0)