Skip to content

Commit 47d43c4

Browse files
committed
Better handling not finding an environment on the schedule page
1 parent a3c7ea3 commit 47d43c4

File tree

1 file changed

+1
-1
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.$scheduleParam

1 file changed

+1
-1
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.$scheduleParam/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
7272

7373
const environment = await findEnvironmentBySlug(project.id, envParam, userId);
7474
if (!environment) {
75-
throw new Error("Environment not found");
75+
return redirectWithErrorMessage("/", request, "Environment not found");
7676
}
7777

7878
const presenter = new ViewSchedulePresenter();

0 commit comments

Comments
 (0)