Skip to content

Commit 5148b16

Browse files
committed
Export cyberchef error types to be used in consuming applications
1 parent b4ae4c5 commit 5148b16

File tree

3 files changed

+24
-30
lines changed

3 files changed

+24
-30
lines changed

package-lock.json

Lines changed: 11 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/errors/index.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import OperationError from "./OperationError.mjs";
2+
import DishError from "./DishError.mjs";
3+
import ExcludedOperationError from "./ExcludedOperationError";
4+
5+
export {
6+
OperationError,
7+
DishError,
8+
ExcludedOperationError,
9+
};

src/node/config/scripts/generateNodeIndex.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ let code = `/**
4141
import NodeDish from "./NodeDish.mjs";
4242
import { _wrap, help, bake, _explainExludedFunction } from "./api.mjs";
4343
import File from "./File.mjs";
44+
import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index";
4445
import {
4546
// import as core_ to avoid name clashes after wrap.
4647
`;
@@ -115,6 +116,9 @@ Object.keys(operations).forEach((op) => {
115116
code += " NodeDish as Dish,\n";
116117
code += " prebaked as bake,\n";
117118
code += " help,\n";
119+
code += " OperationError,\n";
120+
code += " ExcludedOperationError,\n";
121+
code += " DishError,\n";
118122
code += "};\n";
119123

120124

0 commit comments

Comments
 (0)