Use "getErrorMessage" everywhere
This commit is contained in:
@@ -112,11 +112,11 @@ export const useManageMangaLibraryState = (
|
||||
| undefined;
|
||||
try {
|
||||
duplicatedLibraryMangas = await Mangas.getDuplicateLibraryMangas(manga.title).response;
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
await awaitConfirmation({
|
||||
title: t('global.error.label.failed_to_load_data'),
|
||||
message: t('manga.action.library.add.dialog.duplicate.label.failure', {
|
||||
error: e.message,
|
||||
error: getErrorMessage(e),
|
||||
}),
|
||||
actions: {
|
||||
extra: { show: true, title: t('global.button.retry'), contain: true },
|
||||
|
||||
@@ -26,6 +26,7 @@ import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { GetMangaScreenQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_MANGA_SCREEN } from '@/lib/graphql/queries/MangaQuery.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
|
||||
export const Manga: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -82,7 +83,7 @@ export const Manga: React.FC = () => {
|
||||
<>
|
||||
{t('manga.error.label.request_failure')}
|
||||
<br />
|
||||
{error.message ?? error}
|
||||
{getErrorMessage(error)}
|
||||
</>
|
||||
}
|
||||
>
|
||||
@@ -107,7 +108,10 @@ export const Manga: React.FC = () => {
|
||||
|
||||
if (error && !manga) {
|
||||
return (
|
||||
<EmptyViewAbsoluteCentered message={t('manga.error.label.request_failure')} messageExtra={error.message} />
|
||||
<EmptyViewAbsoluteCentered
|
||||
message={t('manga.error.label.request_failure')}
|
||||
messageExtra={getErrorMessage(error)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user