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
expect(() => new Bundle()).toThrowError(
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}`) {
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;
export const BUNDLE = {
MIME_TYPE_MISSING: "Cannot build Bundle. MimeType is missing",
CLOSED: "Cannot add file. Bundle is closed.",
} as const;