(err: unknown, msg: string)
| 2 | * Format error message with hint if available |
| 3 | */ |
| 4 | export const parseError = (err: unknown, msg: string): string => { |
| 5 | let formattedMsg = `${msg}` |
| 6 | if (err instanceof Error) { |
| 7 | formattedMsg += ` ${err.message}.` |
| 8 | // Check if the error has a hint property |
| 9 | if ('hint' in err && typeof err.hint === 'string') { |
| 10 | formattedMsg += ` ${err.hint}.` |
| 11 | } |
| 12 | } |
| 13 | return formattedMsg |
| 14 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…