diff --git a/spec/Bundle.ts b/spec/Bundle.ts index dcb8ff1..ac9d321 100644 --- a/spec/Bundle.ts +++ b/spec/Bundle.ts @@ -22,7 +22,7 @@ describe("Bundle", () => { // @ts-expect-error expect(() => new Bundle()).toThrowError( Error, - "Cannot build Bundle. MimeType is missing", + Messages.BUNDLE.MIME_TYPE_MISSING, ); }); diff --git a/src/Bundle.ts b/src/Bundle.ts index 2ec1f4f..5337965 100644 --- a/src/Bundle.ts +++ b/src/Bundle.ts @@ -21,7 +21,7 @@ export default class Bundle { constructor(public mimeType: `${Mime.type}/${Mime.subtype}`) { if (!mimeType) { - throw new Error("Cannot build Bundle. MimeType is missing"); + throw new Error(Messages.BUNDLE.MIME_TYPE_MISSING); } } diff --git a/src/messages.ts b/src/messages.ts index c20742d..e2ac6c7 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -74,6 +74,7 @@ export const MODELS = { } as const; export const BUNDLE = { + MIME_TYPE_MISSING: "Cannot build Bundle. MimeType is missing", CLOSED: "Cannot add file. Bundle is closed.", } as const;