Extract 30+ single-responsibility modules from manager.ts (1556 LOC): - task lifecycle: task-starter, task-completer, task-canceller, task-resumer - task queries: task-queries, task-poller, task-queue-processor - notifications: notification-builder, notification-tracker, parent-session-notifier - session handling: session-validator, session-output-validator, session-todo-checker - spawner: spawner/ directory with focused spawn modules - utilities: duration-formatter, error-classifier, message-storage-locator - result handling: result-handler-context, background-task-completer - shutdown: background-manager-shutdown, process-signal
22 lines
625 B
TypeScript
22 lines
625 B
TypeScript
export function isAbortedSessionError(error: unknown): boolean {
|
|
const message = getErrorText(error)
|
|
return message.toLowerCase().includes("aborted")
|
|
}
|
|
|
|
export function getErrorText(error: unknown): string {
|
|
if (!error) return ""
|
|
if (typeof error === "string") return error
|
|
if (error instanceof Error) {
|
|
return `${error.name}: ${error.message}`
|
|
}
|
|
if (typeof error === "object" && error !== null) {
|
|
if ("message" in error && typeof error.message === "string") {
|
|
return error.message
|
|
}
|
|
if ("name" in error && typeof error.name === "string") {
|
|
return error.name
|
|
}
|
|
}
|
|
return ""
|
|
}
|