Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions rivetkit-typescript/packages/rivetkit/src/common/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Next } from "hono";
import type { ContentfulStatusCode } from "hono/utils/http-status";
import * as errors from "@/actor/errors";
import { getEnvUniversal } from "@/utils";
import { EXTRA_ERROR_LOG, getEnvUniversal, VERSION } from "@/utils";
import type { Logger } from "./log";

export function assertUnreachable(x: never): never {
Expand Down Expand Up @@ -228,8 +228,7 @@ export function deconstructError(
group,
code,
message,
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
...EXTRA_ERROR_LOG,
...extraLog,
});
} else if (exposeInternalError) {
Expand All @@ -246,8 +245,7 @@ export function deconstructError(
group,
code,
message,
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
...EXTRA_ERROR_LOG,
...extraLog,
});
} else {
Expand All @@ -262,8 +260,7 @@ export function deconstructError(
group,
code,
message,
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
...EXTRA_ERROR_LOG,
...extraLog,
});
}
Expand All @@ -281,8 +278,7 @@ export function deconstructError(
msg: "internal error",
error: getErrorMessage(error),
stack: (error as Error)?.stack,
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
...EXTRA_ERROR_LOG,
...extraLog,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ensureDirectoryExists,
getStoragePath,
} from "@/drivers/file-system/utils";
import { EXTRA_ERROR_LOG } from "@/utils";
import { logger } from "./log";

export const ENGINE_PORT = 6420;
Expand Down Expand Up @@ -110,8 +111,7 @@ export async function ensureEngineProcess(
msg: "engine process exited, please report this error",
code,
signal,
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
...EXTRA_ERROR_LOG,
});
// Clean up log streams
stdoutStream.end();
Expand Down Expand Up @@ -228,8 +228,7 @@ async function downloadEngineBinaryIfNeeded(
msg: "engine download failed, please report this error",
tempPath,
error,
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
...EXTRA_ERROR_LOG,
});
try {
await fs.unlink(tempPath);
Expand Down
6 changes: 6 additions & 0 deletions rivetkit-typescript/packages/rivetkit/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,9 @@ export function arrayBuffersEqual(
}
return true;
}

export const EXTRA_ERROR_LOG = {
issues: "https://github.com/rivet-dev/rivetkit/issues",
support: "https://rivet.dev/discord",
version: VERSION,
};
Loading