Add OperationError error type and use for errors to be printed to the output panel

This commit is contained in:
d98762625 2018-04-27 09:59:10 +01:00
parent a8aa1bc5e8
commit cc20ad9567
10 changed files with 82 additions and 69 deletions

View file

@ -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;