Extract a message string from an error for `.includes()` matching. * Unlike getErrorMessage, this doesn't walk the cause chain and returns "" * for non-Error, non-string values — intentionally narrow for match guards.
(error: unknown)
| 202 | * Unlike getErrorMessage, this doesn't walk the cause chain and returns "" |
| 203 | * for non-Error, non-string values — intentionally narrow for match guards. */ |
| 204 | function errorMessageText(error: unknown): string { |
| 205 | return error instanceof Error ? error.message : typeof error === "string" ? error : ""; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Detect if error is due to encrypted key without passphrase. |
no outgoing calls
no test coverage detected