diff --git a/index.js b/index.js index 37c7396..a4bf45b 100644 --- a/index.js +++ b/index.js @@ -164,7 +164,7 @@ class Action { const json = await response.json(); if (response.status !== 200) { - throw new Error(json.error); + throw new Error(json.error.message); } const { result } = json; @@ -200,7 +200,7 @@ class Action { const json = await response.json(); if (response.status !== 201) { - throw new Error(json.error); + throw new Error(json.error.message); } const { token } = json;