(error: unknown)
| 97 | } |
| 98 | |
| 99 | export function formatError(error: unknown): string { |
| 100 | if (error instanceof Error) { |
| 101 | return String(error); |
| 102 | } else if (typeof error === "object" && error !== null) { |
| 103 | try { |
| 104 | return JSON.stringify(error); |
| 105 | } catch { |
| 106 | return "[object with circular reference]"; |
| 107 | } |
| 108 | } else { |
| 109 | return String(error); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | export function getNextEventOfType( |
| 114 | session: CopilotSession, |
no test coverage detected
searching dependent graphs…