From 45bf9be3b120974cd1a212e5dbcb89d2c3efc630 Mon Sep 17 00:00:00 2001 From: CJ Green <44074998+okaycj@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:50:46 -0400 Subject: [PATCH] Error when no translation is available. --- packages/record/src/errors.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/record/src/errors.ts b/packages/record/src/errors.ts index f8fb2fcf..a8503eb2 100644 --- a/packages/record/src/errors.ts +++ b/packages/record/src/errors.ts @@ -229,3 +229,15 @@ export class ImageNotFoundError extends Error { super(`"${id}" image not found.`); } } + +/** Error throw what specified language isn't found */ +export class TranslationNotFoundError extends Error { + /** + * This will be thrown when attempting to init i18n + * + * @param baseName - Language a2code with region + */ + public constructor(baseName: string) { + super(`"${baseName}" translation not found.`); + } +}