feat: New static error summary component (#3107)

This commit is contained in:
Abhineet Jain
2022-07-22 19:10:40 +00:00
committed by GitHub
parent fd4954b4e5
commit 1b19a09a37
4 changed files with 212 additions and 20 deletions
+3
View File
@@ -83,3 +83,6 @@ export const getValidationErrorMessage = (error: Error | ApiError | unknown): st
isApiError(error) && error.response.data.validations ? error.response.data.validations : []
return validationErrors.map((error) => error.detail).join("\n")
}
export const getErrorDetail = (error: Error | ApiError | unknown): string | undefined | null =>
isApiError(error) ? error.response.data.detail : error instanceof Error ? error.stack : null