MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / describeReason

Function describeReason

graph-ui/src/app/ui-log-install.ts:118–125  ·  view source on GitHub ↗
(reason: unknown)

Source from the content-addressed store, hash-verified

116
117/** What a rejected promise rejected with, as message and stack. */
118export function describeReason(reason: unknown): { message: string; stack?: string } {
119 if (reason instanceof Error) {
120 const stack = typeof reason.stack === 'string' && reason.stack.length > 0 ? reason.stack : undefined;
121 const message = `${reason.name}: ${reason.message}`;
122 return stack === undefined ? { message } : { message, stack };
123 }
124 return { message: safeStringify(reason) };
125}
126
127function newSessionId(): string {
128 const cryptoApi = (globalThis as { crypto?: Crypto }).crypto;

Callers 2

onErrorFunction · 0.85
onRejectionFunction · 0.85

Calls 1

safeStringifyFunction · 0.85

Tested by

no test coverage detected