aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-08 03:44:22 +0800
committerGitHub <noreply@github.com>2018-06-08 03:44:22 +0800
commit9bc6ebde4e4425799ed3ddfb50495029865e3ae8 (patch)
treefe15c8c1abbe77d5e10914ae509b653295862fc6 /packages/utils
parent96b31f39749fb32bd89978245c79aa637791336c (diff)
parent011f14d1155fd3f61e53aaa16681afd5c9c9f892 (diff)
downloaddexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.tar
dexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.tar.gz
dexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.tar.bz2
dexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.tar.lz
dexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.tar.xz
dexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.tar.zst
dexon-sol-tools-9bc6ebde4e4425799ed3ddfb50495029865e3ae8.zip
Merge pull request #671 from 0xProject/refactor/move-spawn-switch-to-utils
Move spawnSwitchErr to @0xproject/utils
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/CHANGELOG.json8
-rw-r--r--packages/utils/src/error_utils.ts5
-rw-r--r--packages/utils/src/index.ts1
3 files changed, 14 insertions, 0 deletions
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index 616a17d62..339d73e05 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,13 @@
[
{
+ "version": "0.6.3",
+ "changes": [
+ {
+ "note": "Added errorUtils.spawnSwitchErr"
+ }
+ ]
+ },
+ {
"timestamp": 1527009133,
"version": "0.6.2",
"changes": [
diff --git a/packages/utils/src/error_utils.ts b/packages/utils/src/error_utils.ts
new file mode 100644
index 000000000..735d3940b
--- /dev/null
+++ b/packages/utils/src/error_utils.ts
@@ -0,0 +1,5 @@
+export const errorUtils = {
+ spawnSwitchErr(name: string, value: any): Error {
+ return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
+ },
+};
diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts
index 709ec93b2..fd102cecb 100644
--- a/packages/utils/src/index.ts
+++ b/packages/utils/src/index.ts
@@ -7,3 +7,4 @@ export { AbiDecoder } from './abi_decoder';
export { logUtils } from './log_utils';
export { abiUtils } from './abi_utils';
export { NULL_BYTES } from './constants';
+export { errorUtils } from './error_utils';