Skip to content

Commit

Permalink
Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Feb 7, 2024
1 parent cdd0521 commit e99e16c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e99e16c

Please sign in to comment.