import axios, { AxiosError } from 'axios'; import PrettyJson from './Common/PrettyJSON'; export type ErrorInfo = string | Error | AxiosError | undefined; interface BackendErrorProps { error: ErrorInfo } function DescribeError(error: ErrorInfo) { console.log(error); if (!error) { return
Ошибки отсутствуют
; } else if (typeof error === 'string') { return{error}
; } else if (!axios.isAxiosError(error)) { returnНет ответа от сервера
; } if (error.response.status === 404) { return ({`Обращение к несуществующему API`}
Ошибка
{error.message}
{error.response.data && (<>Описание
{ isHtml && } { !isHtml &&