Skip to content

Commit bcad519

Browse files
d-csclaude
andcommitted
chore(webapp): downgrade SVE logs in api.v1.projects.background-workers to warn
ServiceValidationError and CreateDeclarativeScheduleError are user-facing validation failures returned as 4xx; they shouldn't surface in Sentry. Move type discrimination before the log call and split the SVE/CDSE branches at warn level. Real 5xx errors continue to log at error. Refs the ignoreErrors filter added in dac9c83; closes the wrapper-bypass gap on TRIGGER-CLOUD-2S. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 386b4f6 commit bcad519

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,20 @@ export async function action({ request, params }: ActionFunctionArgs) {
5858
{ status: 200 }
5959
);
6060
} catch (e) {
61-
logger.error("Failed to create background worker", { error: JSON.stringify(e) });
62-
61+
// Customer-facing validation failures (invalid task config, customer cron
62+
// expression, etc.). The handler returns 4xx with the message; system
63+
// handles it gracefully, no alert needed.
6364
if (e instanceof ServiceValidationError) {
65+
logger.warn("Failed to create background worker", { error: e.message });
6466
return json({ error: e.message }, { status: 400 });
65-
} else if (e instanceof CreateDeclarativeScheduleError) {
67+
}
68+
if (e instanceof CreateDeclarativeScheduleError) {
69+
logger.warn("Failed to create background worker", { error: e.message });
6670
return json({ error: e.message }, { status: 400 });
6771
}
6872

73+
logger.error("Failed to create background worker", { error: e });
74+
6975
return json({ error: "Failed to create background worker" }, { status: 500 });
7076
}
7177
}

0 commit comments

Comments
 (0)