(error: any, def: string = "")
| 12 | } |
| 13 | |
| 14 | export function getValidatorErrorMsg(error: any, def: string = "") { |
| 15 | if (error.message) { |
| 16 | return error.message; |
| 17 | } |
| 18 | if (error.errorFields instanceof Array) { |
| 19 | return String(error.errorFields[0]?.errors[0] || ""); |
| 20 | } |
| 21 | if (error === null || error === undefined) { |
| 22 | return def; |
| 23 | } |
| 24 | return String(error); |
| 25 | } |
| 26 | |
| 27 | export function reportValidatorError(error: any) { |
| 28 | console.error("Function reportValidatorError():", error); |
no outgoing calls
no test coverage detected