Skip to content

Commit

Permalink
Fix JSON error parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillweston committed Jun 3, 2024
1 parent 76d85d6 commit e6f41cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/twitter-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async function handleAction(action) {

if (!actionResponse.ok) {
const responseBody = await actionResponse.json();
const responseData = JSON.parse(responseBody.data);
const responseData = responseBody.data;
const errorMessage = responseData.errors[0].message;
throw new Error(`Failed to execute ${action}. Status: ${actionResponse.status}. Error: ${errorMessage}`);
}
Expand Down

0 comments on commit e6f41cc

Please sign in to comment.