mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
Introduced use of conditional chaining operator
This commit is contained in:
parent
570206af77
commit
b92501ee35
14 changed files with 493 additions and 495 deletions
|
@ -230,14 +230,12 @@ class Recipe {
|
|||
this.lastRunOp = op;
|
||||
} catch (err) {
|
||||
// Return expected errors as output
|
||||
if (err instanceof OperationError ||
|
||||
(err.type && err.type === "OperationError")) {
|
||||
if (err instanceof OperationError || err?.type === "OperationError") {
|
||||
// Cannot rely on `err instanceof OperationError` here as extending
|
||||
// native types is not fully supported yet.
|
||||
dish.set(err.message, "string");
|
||||
return i;
|
||||
} else if (err instanceof DishError ||
|
||||
(err.type && err.type === "DishError")) {
|
||||
} else if (err instanceof DishError || err?.type === "DishError") {
|
||||
dish.set(err.message, "string");
|
||||
return i;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue