Skip to content

Commit 9624465

Browse files
authored
fix: error handling issue with s2 streams (#2664)
* Fix logger import *old man yells at auto-import* * Fix s2 error handling for non-existing streams
1 parent 42f53b1 commit 9624465

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
DeploymentErrorData,
33
ExternalBuildData,
4-
logger,
54
prepareDeploymentError,
65
} from "@trigger.dev/core/v3";
76
import { type RuntimeEnvironment, type WorkerDeployment } from "@trigger.dev/database";
@@ -16,6 +15,7 @@ import { S2 } from "@s2-dev/streamstore";
1615
import { env } from "~/env.server";
1716
import { createRedisClient } from "~/redis.server";
1817
import { tryCatch } from "@trigger.dev/core";
18+
import { logger } from "~/services/logger.server";
1919

2020
const S2_TOKEN_KEY_PREFIX = "s2-token:project:";
2121

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ export default function Page() {
137137
} catch (error) {
138138
if (abortController.signal.aborted) return;
139139

140-
const isNotFoundError = error instanceof S2Error && error.code === "stream_not_found";
140+
const isNotFoundError =
141+
error instanceof S2Error &&
142+
error.code &&
143+
["permission_denied", "stream_not_found"].includes(error.code);
141144
if (isNotFoundError) return;
142145

143146
console.error("Failed to stream logs:", error);

0 commit comments

Comments
 (0)