* Converts unknown error-like values into printable strings.
(error: unknown)
| 192 | * Converts unknown error-like values into printable strings. |
| 193 | */ |
| 194 | function formatError(error: unknown): string { |
| 195 | if (error instanceof Error) { |
| 196 | return error.stack ?? error.message; |
| 197 | } |
| 198 | try { |
| 199 | return JSON.stringify(error); |
| 200 | } catch { |
| 201 | return String(error); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Returns the logs directory inside the arctic config folder. |
no outgoing calls
no test coverage detected