aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-26 05:19:40 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-26 05:19:40 +0800
commit1a10715fcb21a89aa47cade6d796eeb677f9741d (patch)
treec6c5b502f864d129db362372a12429d8d7a436b4 /packages/instant/src/util
parent2a1c2a55eda0f3d279aa1145b6157892d03001ae (diff)
downloaddexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.tar
dexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.tar.gz
dexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.tar.bz2
dexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.tar.lz
dexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.tar.xz
dexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.tar.zst
dexon-sol-tools-1a10715fcb21a89aa47cade6d796eeb677f9741d.zip
feat: flash an error if the wrong network is detected
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r--packages/instant/src/util/error.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/instant/src/util/error.ts b/packages/instant/src/util/error.ts
index f5a3d2cb8..0868414f0 100644
--- a/packages/instant/src/util/error.ts
+++ b/packages/instant/src/util/error.ts
@@ -1,4 +1,5 @@
import { AssetBuyerError } from '@0x/asset-buyer';
+import * as _ from 'lodash';
import { Dispatch } from 'redux';
import { Action, actions } from '../redux/actions';
@@ -55,6 +56,9 @@ export const errorUtil = {
if (error instanceof Error) {
bestMessage = humanReadableMessageForError(error, asset);
}
+ if (_.isString(error)) {
+ bestMessage = error;
+ }
return {
icon: '😢',
message: bestMessage || 'Something went wrong...',