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
This commit is contained in:
Saadi Myftija
2025-11-11 09:44:54 +01:00
committed by GitHub
parent 42f53b12b7
commit 9624465ee2
2 changed files with 5 additions and 2 deletions
@@ -1,7 +1,6 @@
import {
DeploymentErrorData,
ExternalBuildData,
logger,
prepareDeploymentError,
} from "@trigger.dev/core/v3";
import { type RuntimeEnvironment, type WorkerDeployment } from "@trigger.dev/database";
@@ -16,6 +15,7 @@ import { S2 } from "@s2-dev/streamstore";
import { env } from "~/env.server";
import { createRedisClient } from "~/redis.server";
import { tryCatch } from "@trigger.dev/core";
import { logger } from "~/services/logger.server";
const S2_TOKEN_KEY_PREFIX = "s2-token:project:";
@@ -137,7 +137,10 @@ export default function Page() {
} catch (error) {
if (abortController.signal.aborted) return;
const isNotFoundError = error instanceof S2Error && error.code === "stream_not_found";
const isNotFoundError =
error instanceof S2Error &&
error.code &&
["permission_denied", "stream_not_found"].includes(error.code);
if (isNotFoundError) return;
console.error("Failed to stream logs:", error);