mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Throw ExcludedOperationError when excluded operation is called from API
This commit is contained in:
parent
7c9ebafd00
commit
96d5930f05
6 changed files with 143 additions and 8 deletions
25
src/core/errors/ExcludedOperationError.mjs
Normal file
25
src/core/errors/ExcludedOperationError.mjs
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Custom error type for handling operation that isnt included in node.js API
|
||||
*
|
||||
* @author d98762625 [d98762625@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
class ExcludedOperationError extends Error {
|
||||
/**
|
||||
* Standard error constructor. Adds no new behaviour.
|
||||
*
|
||||
* @param args - Standard error args
|
||||
*/
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.type = "ExcludedOperationError";
|
||||
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, ExcludedOperationError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ExcludedOperationError;
|
Loading…
Add table
Add a link
Reference in a new issue