Bundle: added another message to Messages

This commit is contained in:
Alexander Cerutti
2021-10-16 00:41:14 +02:00
parent 7714c15949
commit 74e98c1738
3 changed files with 3 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ describe("Bundle", () => {
// @ts-expect-error // @ts-expect-error
expect(() => new Bundle()).toThrowError( expect(() => new Bundle()).toThrowError(
Error, Error,
"Cannot build Bundle. MimeType is missing", Messages.BUNDLE.MIME_TYPE_MISSING,
); );
}); });

View File

@@ -21,7 +21,7 @@ export default class Bundle {
constructor(public mimeType: `${Mime.type}/${Mime.subtype}`) { constructor(public mimeType: `${Mime.type}/${Mime.subtype}`) {
if (!mimeType) { if (!mimeType) {
throw new Error("Cannot build Bundle. MimeType is missing"); throw new Error(Messages.BUNDLE.MIME_TYPE_MISSING);
} }
} }

View File

@@ -74,6 +74,7 @@ export const MODELS = {
} as const; } as const;
export const BUNDLE = { export const BUNDLE = {
MIME_TYPE_MISSING: "Cannot build Bundle. MimeType is missing",
CLOSED: "Cannot add file. Bundle is closed.", CLOSED: "Cannot add file. Bundle is closed.",
} as const; } as const;