| 1521 | ); |
| 1522 | |
| 1523 | const formatUnknownMessage = (cause: unknown): string => { |
| 1524 | if (cause instanceof Error) return cause.message; |
| 1525 | if (typeof cause === "string") return cause; |
| 1526 | if (typeof cause === "object" && cause !== null && "message" in cause) { |
| 1527 | const message = cause.message; |
| 1528 | if (typeof message === "string") return message; |
| 1529 | } |
| 1530 | return String(cause); |
| 1531 | }; |
| 1532 | |
| 1533 | const readCliLogLevel = (argv: ReadonlyArray<string>): string | undefined => { |
| 1534 | for (let index = 0; index < argv.length; index += 1) { |