mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 03:00:48 +00:00
* Add lefthook formatter checks * Fix SDK mode hydration * Stabilize SDK mode integration test
27 lines
751 B
TypeScript
27 lines
751 B
TypeScript
export function resolveErrorMessage(error: unknown): string {
|
|
if (error instanceof Error) {
|
|
return error.message;
|
|
}
|
|
return String(error);
|
|
}
|
|
|
|
export function isActorNotFoundError(error: unknown): boolean {
|
|
return resolveErrorMessage(error).includes("Actor not found:");
|
|
}
|
|
|
|
export function resolveErrorStack(error: unknown): string | undefined {
|
|
if (error instanceof Error && typeof error.stack === "string") {
|
|
return error.stack;
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
export function logActorWarning(scope: string, message: string, context?: Record<string, unknown>): void {
|
|
const payload = {
|
|
scope,
|
|
message,
|
|
...(context ?? {}),
|
|
};
|
|
// eslint-disable-next-line no-console
|
|
console.warn("[openhandoff][actor:warn]", payload);
|
|
}
|