(externalError: Error | null | undefined)
| 572 | } |
| 573 | |
| 574 | function getExternalErrorMessage(externalError: Error | null | undefined): string { |
| 575 | if (!externalError) return ''; |
| 576 | |
| 577 | // In case an error is not a real error |
| 578 | if (!(externalError instanceof Error)) { |
| 579 | return externalError; |
| 580 | } |
| 581 | // In case it's not a bit error |
| 582 | if (externalError.message) { |
| 583 | return externalError.message; |
| 584 | } |
| 585 | const errorDefinition = findErrorDefinition(externalError); |
| 586 | const func = getErrorFunc(errorDefinition); |
| 587 | const errorMessage = getErrorMessage(externalError, func); |
| 588 | return errorMessage; |
| 589 | } |
| 590 | |
| 591 | function getExternalErrorsMessageAndStack(errors: Error[]): string { |
| 592 | const result = errors |
no test coverage detected