(error: any, defaultMsg: string)
| 38 | } |
| 39 | |
| 40 | export const getErrorMsg = (error: any, defaultMsg: string) => { |
| 41 | const isErrorMessage = error instanceof Error; |
| 42 | const errorMessage = isErrorMessage |
| 43 | ? error.message.trim() || defaultMsg |
| 44 | : defaultMsg; |
| 45 | return errorMessage; |
| 46 | }; |
| 47 | |
| 48 | /** |
| 49 | * Formats the given number of bytes into a human-readable string representation. |
no outgoing calls
no test coverage detected