| 1498 | ); |
| 1499 | |
| 1500 | const formatUnknownMessage = (cause: unknown): string => { |
| 1501 | if (cause instanceof Error) return cause.message; |
| 1502 | if (typeof cause === "string") return cause; |
| 1503 | if (typeof cause === "object" && cause !== null && "message" in cause) { |
| 1504 | const message = cause.message; |
| 1505 | if (typeof message === "string") return message; |
| 1506 | } |
| 1507 | return String(cause); |
| 1508 | }; |
| 1509 | |
| 1510 | const readCliLogLevel = (argv: ReadonlyArray<string>): string | undefined => { |
| 1511 | for (let index = 0; index < argv.length; index += 1) { |