Custom error for missing override

This commit is contained in:
Dominik Reh
2023-01-29 00:37:39 +01:00
parent 98000bd2fc
commit 3e0a7cc796

View File

@@ -1,3 +1,10 @@
class FunctionNotOverriddenError extends Error {
constructor(message = "", ...args) {
super(message, ...args);
this.message = message + " is an abstract base function and must be overwritten.";
}
}
class BaseTagParser {
triggerCondition = null;
@@ -9,6 +16,6 @@ class BaseTagParser {
}
parse() {
throw new NotImplementedError();
throw new FunctionNotOverriddenError("parse()");
}
}