(error: unknown)
| 2 | * Format an error for structured logging with message and optional stack trace. |
| 3 | */ |
| 4 | export function formatError(error: unknown): { error: string; stack?: string } { |
| 5 | if (error instanceof Error) { |
| 6 | return { error: error.message, stack: error.stack }; |
| 7 | } |
| 8 | return { error: String(error) }; |
| 9 | } |
no outgoing calls
no test coverage detected