mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Address instrumentation review feedback
This commit is contained in:
parent
efb6602ac5
commit
23191f813e
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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 = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user