fix(taglist-order): improve error handler when the order does not exists

This commit is contained in:
Joxit
2023-05-18 07:28:07 +02:00
parent 92584fc3da
commit c6dee14d79
4 changed files with 9 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
export class DockerRegistryUIError extends Error {
constructor(msg) {
super(msg);
this.isError = true;
}
}

View File

@@ -20,7 +20,7 @@ export const taglistOrderVariants = (taglistOrder) => {
} else if (TAGLIST_ORDER_REGEX.test(taglistOrder)) {
return taglistOrder;
}
throw new DockerRegistryUIError(`The order \`${taglistOrder}\` is not recognized.`);
throw new DockerRegistryUIError(`The taglist order \`${taglistOrder}\` is not recognized.`);
}
};