Add logger that encapsulates console logging

This commit is contained in:
Johannes Loher 2021-06-26 14:32:40 +02:00
parent 1f6d13c49d
commit a987b59b65
12 changed files with 92 additions and 57 deletions

View file

@ -45,5 +45,5 @@ export async function rollCheck(check: Check): Promise<void> {
return notifications.warn(game.i18n.localize("DS4.WarningMustControlActorToUseRollCheckMacro"));
}
return actor.rollCheck(check);
return actor.rollCheck(check).catch((e) => notifications.error(e, { log: true }));
}

View file

@ -9,5 +9,5 @@ export async function rollGenericCheck(): Promise<void> {
return notifications.warn(game.i18n.localize("DS4.WarningMustControlActorToUseRollCheckMacro"));
}
return actor.rollGenericCheck();
return actor.rollGenericCheck().catch((e) => notifications.error(e, { log: true }));
}

View file

@ -53,5 +53,5 @@ export async function rollItem(itemId: string): Promise<void> {
);
}
return item.roll();
return item.roll().catch((e) => notifications.error(e, { log: true }));
}