aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-10-25 00:11:35 -0700
committerAdam Soltys <[email protected]>2022-10-25 00:11:35 -0700
commit8795475b6489b5200ac960be25349d2e5c84cf88 (patch)
tree97369f2a128b778a0344b7a6e7458de47eab9769 /src/lib/utils.js
parent71b6d876274ad1f6c5716df4d57b588f247ec464 (diff)
downloadcoinos-ui-8795475b6489b5200ac960be25349d2e5c84cf88.tar.gz
coinos-ui-8795475b6489b5200ac960be25349d2e5c84cf88.zip
send pin
Diffstat (limited to 'src/lib/utils.js')
-rw-r--r--src/lib/utils.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js
index d8a7b60c..7eeab648 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -42,6 +42,8 @@ export const post = (url, body, headers) => {
throw new Error(body);
}
+
+ if (body.error) throw body.error;
if (body instanceof Error) throw body;
if (body.name === 'Error') throw new Error(body.message);