Skip to content

Commit d559275

Browse files
committed
fix(webapp): soften 500 error copy with retry hint
Update the user-facing copy I introduced in the 5xx sanitisation sweep to include a retry hint ("Something went wrong, please try again." / "Failed to <action> notification, please try again."). Routes that already used "Internal server error" or "Something went wrong" before this PR are left as-is — no copy churn for unaffected routes.
1 parent 6c1fda8 commit d559275

14 files changed

Lines changed: 19 additions & 19 deletions

apps/webapp/app/routes/admin.api.v1.platform-notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function action({ request }: ActionFunctionArgs) {
4444
}
4545

4646
logger.error("Failed to create platform notification", { error });
47-
return json({ error: "Something went wrong" }, { status: 500 });
47+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
4848
}
4949

5050
return json(result.value, { status: 201 });

apps/webapp/app/routes/admin.notifications.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async function handleCreateAction(formData: FormData, userId: string, isPreview:
236236
);
237237
}
238238
logger.error("Failed to create platform notification", { error: err });
239-
return typedjson({ error: "Something went wrong" }, { status: 500 });
239+
return typedjson({ error: "Something went wrong, please try again." }, { status: 500 });
240240
}
241241

242242
if (isPreview) {
@@ -256,7 +256,7 @@ async function handleArchiveAction(formData: FormData) {
256256
return typedjson({ success: true });
257257
} catch (error) {
258258
logger.error("Failed to archive platform notification", { error, notificationId });
259-
return typedjson({ error: "Failed to archive notification" }, { status: 500 });
259+
return typedjson({ error: "Failed to archive notification, please try again." }, { status: 500 });
260260
}
261261
}
262262

@@ -271,7 +271,7 @@ async function handleDeleteAction(formData: FormData) {
271271
return typedjson({ success: true });
272272
} catch (error) {
273273
logger.error("Failed to delete platform notification", { error, notificationId });
274-
return typedjson({ error: "Failed to delete notification" }, { status: 500 });
274+
return typedjson({ error: "Failed to delete notification, please try again." }, { status: 500 });
275275
}
276276
}
277277

@@ -286,7 +286,7 @@ async function handlePublishNowAction(formData: FormData) {
286286
return typedjson({ success: true });
287287
} catch (error) {
288288
logger.error("Failed to publish platform notification", { error, notificationId });
289-
return typedjson({ error: "Failed to publish notification" }, { status: 500 });
289+
return typedjson({ error: "Failed to publish notification, please try again." }, { status: 500 });
290290
}
291291
}
292292

@@ -328,7 +328,7 @@ async function handleEditAction(formData: FormData) {
328328
);
329329
}
330330
logger.error("Failed to update platform notification", { error: err });
331-
return typedjson({ error: "Something went wrong" }, { status: 500 });
331+
return typedjson({ error: "Something went wrong, please try again." }, { status: 500 });
332332
}
333333

334334
return typedjson({ success: true, id: result.value.id });

apps/webapp/app/routes/api.v1.batches.$batchParam.results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
3838
return json(result);
3939
} catch (error) {
4040
logger.error("Failed to load batch results", { error });
41-
return json({ error: "Something went wrong" }, { status: 500 });
41+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
4242
}
4343
}

apps/webapp/app/routes/api.v1.projects.$projectRef.alertChannels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
9090
}
9191

9292
logger.error("Failed to create alert channel", { error });
93-
return json({ error: "Something went wrong" }, { status: 500 });
93+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
9494
}
9595
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const loader = createLoaderApiRoute(
3737
}
3838

3939
logger.error("Failed to list queues", { error });
40-
return json({ error: "Something went wrong" }, { status: 500 });
40+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
4141
}
4242
}
4343
);

apps/webapp/app/routes/api.v1.runs.$runId.tags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
8787
return json({ message: `Successfully set ${newTags.length} new tags.` }, { status: 200 });
8888
} catch (error) {
8989
logger.error("Failed to add run tags", { error });
90-
return json({ error: "Something went wrong" }, { status: 500 });
90+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
9191
}
9292
}

apps/webapp/app/routes/api.v1.runs.$runParam.attempts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
4242
}
4343

4444
logger.error("Failed to create run attempt", { error });
45-
return json({ error: "Something went wrong" }, { status: 500 });
45+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
4646
}
4747
}

apps/webapp/app/routes/api.v1.runs.$runParam.reschedule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
8888
}
8989

9090
logger.error("Failed to reschedule run", { error });
91-
return json({ error: "Something went wrong" }, { status: 500 });
91+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
9292
}
9393
}

apps/webapp/app/routes/api.v1.runs.$runParam.result.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
3737
return json(result);
3838
} catch (error) {
3939
logger.error("Failed to load run result", { error });
40-
return json({ error: "Something went wrong" }, { status: 500 });
40+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
4141
}
4242
}

apps/webapp/app/routes/api.v1.schedules.$scheduleId.activate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
7070
return json(presenter.toJSONResponse(result), { status: 200 });
7171
} catch (error) {
7272
logger.error("Failed to activate schedule", { error });
73-
return json({ error: "Something went wrong" }, { status: 500 });
73+
return json({ error: "Something went wrong, please try again." }, { status: 500 });
7474
}
7575
}

0 commit comments

Comments
 (0)