2018-04-27 10:59:10 +02:00
|
|
|
/**
|
2018-04-30 19:25:13 +02:00
|
|
|
* Custom error type for handling operation input errors.
|
|
|
|
* i.e. where the operation can handle the error and print a message to the screen.
|
|
|
|
*
|
|
|
|
* @author d98762625 [d98762625@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2018
|
|
|
|
* @license Apache-2.0
|
2018-04-27 10:59:10 +02:00
|
|
|
*/
|
|
|
|
class OperationError extends Error {
|
|
|
|
/**
|
|
|
|
* Standard error constructor. Adds no new behaviour.
|
2018-04-30 19:25:13 +02:00
|
|
|
*
|
|
|
|
* @param args - Standard error args
|
2018-04-27 10:59:10 +02:00
|
|
|
*/
|
|
|
|
constructor(...args) {
|
|
|
|
super(...args);
|
|
|
|
|
2018-05-16 11:17:49 +02:00
|
|
|
this.type = "OperationError";
|
|
|
|
|
2018-04-27 10:59:10 +02:00
|
|
|
if (Error.captureStackTrace) {
|
|
|
|
Error.captureStackTrace(this, OperationError);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default OperationError;
|