Skip to content

Commit feb2f40

Browse files
committed
fix(rivetkit): keep internal error exposure behavior consistent
1 parent f676d13 commit feb2f40

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

rivetkit-typescript/packages/rivetkit/src/actor/router-endpoints.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,10 @@ export function getRequestEncoding(req: HonoRequest): Encoding {
373373

374374
/**
375375
* Determines whether internal errors should be exposed to the client.
376-
* Returns true if RIVET_EXPOSE_ERRORS=1 or NODE_ENV=development.
376+
* Returns true if RIVET_EXPOSE_ERRORS=1.
377377
*/
378378
export function getRequestExposeInternalError(_req: Request): boolean {
379-
return (
380-
getEnvUniversal("RIVET_EXPOSE_ERRORS") === "1" ||
381-
getEnvUniversal("NODE_ENV") === "development"
382-
);
379+
return getEnvUniversal("RIVET_EXPOSE_ERRORS") === "1";
383380
}
384381

385382
export function getRequestQuery(c: HonoContext): unknown {

rivetkit-typescript/packages/rivetkit/src/dynamic/isolate-runtime.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ function getRequestConnParams(request: Request): unknown {
102102
}
103103

104104
function getRequestExposeInternalError(): boolean {
105-
return (
106-
getEnvUniversal("RIVET_EXPOSE_ERRORS") === "1" ||
107-
getEnvUniversal("NODE_ENV") === "development"
108-
);
105+
return getEnvUniversal("RIVET_EXPOSE_ERRORS") === "1";
109106
}
110107

111108
function buildErrorResponse(request: Request, error: unknown): Response {
@@ -476,7 +473,11 @@ export class DynamicActorIsolateRuntime {
476473
XDG_DATA_HOME: `${DYNAMIC_SANDBOX_APP_ROOT}/.local/share`,
477474
XDG_CACHE_HOME: `${DYNAMIC_SANDBOX_APP_ROOT}/.cache`,
478475
TMPDIR: DYNAMIC_SANDBOX_TMP_ROOT,
479-
RIVET_EXPOSE_ERRORS: "1",
476+
...(process.env.RIVET_EXPOSE_ERRORS
477+
? {
478+
RIVET_EXPOSE_ERRORS: process.env.RIVET_EXPOSE_ERRORS,
479+
}
480+
: {}),
480481
...(process.env.RIVETKIT_TEST_DOCKER_HELPER_URL
481482
? {
482483
RIVETKIT_TEST_DOCKER_HELPER_URL:

0 commit comments

Comments
 (0)