Log promise failures instead of ignoring them (#531)

In case the failure does not get handled, it should at least get logged, to prevent silently ignoring it
This commit is contained in:
schroda
2023-12-31 01:42:54 +01:00
committed by GitHub
parent 37d6b84cf4
commit 37ce494fda
10 changed files with 44 additions and 13 deletions

View File

@@ -21,6 +21,7 @@ import { SelectableCollectionReturnType } from '@/components/collection/useSelec
import { CategorySelect } from '@/components/navbar/action/CategorySelect.tsx';
import { MenuItem } from '@/components/menu/MenuItem.tsx';
import { createGetMenuItemTitle, createIsMenuItemDisabled, createShouldShowMenuItem } from '@/components/menu/util.ts';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
const ACTION_DISABLES_SELECTION_MODE: MangaAction[] = ['remove_from_library'] as const;
@@ -63,7 +64,7 @@ export const MangaActionMenuItems = ({ manga, handleSelection, selectedMangas =
const performAction = (action: MangaAction, mangas: TManga[]) => {
Mangas.performAction(action, manga ? [manga.id] : Mangas.getIds(mangas), {
wasManuallyMarkedAsRead: true,
}).catch(() => {});
}).catch(defaultPromiseErrorHandler(`MangaActionMenuItems:performAction(${action})`));
onClose(!ACTION_DISABLES_SELECTION_MODE.includes(action));
};