|
@@ -15,11 +15,14 @@ export function handleServerError(error: unknown) {
|
|
|
'status' in error &&
|
|
'status' in error &&
|
|
|
Number(error.status) === 204
|
|
Number(error.status) === 204
|
|
|
) {
|
|
) {
|
|
|
- errMsg = 'Content not found.'
|
|
|
|
|
|
|
+ errMsg = 'No content.'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (error instanceof AxiosError) {
|
|
if (error instanceof AxiosError) {
|
|
|
- errMsg = error.response?.data.title
|
|
|
|
|
|
|
+ const title = error.response?.data?.title
|
|
|
|
|
+ if (typeof title === 'string' && title.length > 0) {
|
|
|
|
|
+ errMsg = title
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
toast.error(errMsg)
|
|
toast.error(errMsg)
|