Skip to content

Commit 74dfc47

Browse files
committed
chore(rivetkit): log version with error logs
1 parent 80b8e25 commit 74dfc47

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

rivetkit-typescript/packages/rivetkit/src/common/utils.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Next } from "hono";
22
import type { ContentfulStatusCode } from "hono/utils/http-status";
33
import * as errors from "@/actor/errors";
4-
import { getEnvUniversal } from "@/utils";
4+
import { EXTRA_ERROR_LOG, getEnvUniversal, VERSION } from "@/utils";
55
import type { Logger } from "./log";
66

77
export function assertUnreachable(x: never): never {
@@ -228,8 +228,7 @@ export function deconstructError(
228228
group,
229229
code,
230230
message,
231-
issues: "https://github.com/rivet-dev/rivetkit/issues",
232-
support: "https://rivet.dev/discord",
231+
...EXTRA_ERROR_LOG,
233232
...extraLog,
234233
});
235234
} else if (exposeInternalError) {
@@ -246,8 +245,7 @@ export function deconstructError(
246245
group,
247246
code,
248247
message,
249-
issues: "https://github.com/rivet-dev/rivetkit/issues",
250-
support: "https://rivet.dev/discord",
248+
...EXTRA_ERROR_LOG,
251249
...extraLog,
252250
});
253251
} else {
@@ -262,8 +260,7 @@ export function deconstructError(
262260
group,
263261
code,
264262
message,
265-
issues: "https://github.com/rivet-dev/rivetkit/issues",
266-
support: "https://rivet.dev/discord",
263+
...EXTRA_ERROR_LOG,
267264
...extraLog,
268265
});
269266
}
@@ -281,8 +278,7 @@ export function deconstructError(
281278
msg: "internal error",
282279
error: getErrorMessage(error),
283280
stack: (error as Error)?.stack,
284-
issues: "https://github.com/rivet-dev/rivetkit/issues",
285-
support: "https://rivet.dev/discord",
281+
...EXTRA_ERROR_LOG,
286282
...extraLog,
287283
});
288284
}

rivetkit-typescript/packages/rivetkit/src/engine-process/mod.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
ensureDirectoryExists,
99
getStoragePath,
1010
} from "@/drivers/file-system/utils";
11+
import { EXTRA_ERROR_LOG } from "@/utils";
1112
import { logger } from "./log";
1213

1314
export const ENGINE_PORT = 6420;
@@ -110,8 +111,7 @@ export async function ensureEngineProcess(
110111
msg: "engine process exited, please report this error",
111112
code,
112113
signal,
113-
issues: "https://github.com/rivet-dev/rivetkit/issues",
114-
support: "https://rivet.dev/discord",
114+
...EXTRA_ERROR_LOG,
115115
});
116116
// Clean up log streams
117117
stdoutStream.end();
@@ -228,8 +228,7 @@ async function downloadEngineBinaryIfNeeded(
228228
msg: "engine download failed, please report this error",
229229
tempPath,
230230
error,
231-
issues: "https://github.com/rivet-dev/rivetkit/issues",
232-
support: "https://rivet.dev/discord",
231+
...EXTRA_ERROR_LOG,
233232
});
234233
try {
235234
await fs.unlink(tempPath);

rivetkit-typescript/packages/rivetkit/src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,9 @@ export function arrayBuffersEqual(
263263
}
264264
return true;
265265
}
266+
267+
export const EXTRA_ERROR_LOG = {
268+
issues: "https://github.com/rivet-dev/rivetkit/issues",
269+
support: "https://rivet.dev/discord",
270+
version: VERSION,
271+
};

0 commit comments

Comments
 (0)