mirror of
https://github.com/coder/coder.git
synced 2026-10-24 01:26:25 +08:00
feat: New static error summary component (#3107)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user