Address instrumentation review feedback

This commit is contained in:
Devin AI 2026-05-29 22:55:35 +00:00
parent efb6602ac5
commit 23191f813e
2 changed files with 6 additions and 4 deletions

View File

@ -1,9 +1,9 @@
import "server-only";
import { getEnvVariable } from "@hexclave/shared/dist/utils/env";
import { getEnvBoolean } from "@hexclave/shared/dist/utils/env";
export async function startRemoteDevelopmentEnvironmentLifecycleIfNeeded(): Promise<void> {
if (getEnvVariable("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT", "") !== "true") {
if (!getEnvBoolean("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT")) {
return;
}

View File

@ -31,8 +31,10 @@ export async function register(): Promise<void> {
let nicified;
try {
nicified = nicify(error, { maxDepth: 8 });
} catch (e) {
nicified = `Error occurred during nicification: ${e}`;
} catch (nicifyError: unknown) {
// Only nicify errors are converted to metadata; the original event still reports.
const nicifyErrorMessage = nicifyError instanceof Error ? nicifyError.message : String(nicifyError);
nicified = `Error occurred during nicification: ${nicifyErrorMessage}`;
}
if (error instanceof Error) {
event.extra = {