(cause: unknown)
| 139 | |
| 140 | /** First driver error code in the cause chain, if any. Never the error text. */ |
| 141 | const causeCode = (cause: unknown): string | undefined => { |
| 142 | let found: string | undefined; |
| 143 | walkCauses(cause, (err) => { |
| 144 | const code = err["code"]; |
| 145 | if (typeof code === "string" && code.length > 0) { |
| 146 | found = code; |
| 147 | return true; |
| 148 | } |
| 149 | return false; |
| 150 | }); |
| 151 | return found; |
| 152 | }; |
| 153 | |
| 154 | /** Connection-fault code in the cause chain, if this is a connection fault at all. */ |
| 155 | const connectionFaultCode = (cause: unknown): string | undefined => { |
no test coverage detected