(error: unknown)
| 97 | * and contains validation messages for different form fields. |
| 98 | */ |
| 99 | export const getValidationErrorMessage = (error: unknown): string => { |
| 100 | const validationErrors = |
| 101 | isApiError(error) && error.response.data.validations |
| 102 | ? error.response.data.validations |
| 103 | : []; |
| 104 | return validationErrors.map((error) => error.detail).join("\n"); |
| 105 | }; |
| 106 | |
| 107 | export const getErrorDetail = (error: unknown): string | undefined => { |
| 108 | if (error instanceof DetailedError) { |
no test coverage detected