Add OperationError error type and use for errors to be printed to the output panel
This commit is contained in:
1 parent
a8aa1bc5e8
commit
cc20ad9567
10 files changed
+82
-69
No files matched your search
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Create custom error type for handling operation input errors.
|
||||
* i.e. where the operation can handle the error and print a
|
||||
* message to the screen.
|
||||
*/
|
||||
class OperationError extends Error {
|
||||
/**
|
||||
* Standard error constructor. Adds no new behaviour.
|
||||
* @param args standard error args
|
||||
*/
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, OperationError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default OperationError;
|
||||
Reference in new issue
Block a user