Skip to content

Commit

Permalink
add catch
Browse files Browse the repository at this point in the history
  • Loading branch information
butackle committed Mar 2, 2024
1 parent 32b039a commit a2615d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/service/misskey/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ const fetchApi = (pathName: string, apiKey: string) => {
headers,
body: JSON.stringify({...body, i: apiKey}),
})

if (!res.ok) {
console.error('fetchApi error', {pathName}, res.status, res.statusText);
console.error('fetchApi error', {pathName}, await res.text());
return;
}

return await res.text();
};
}
Expand Down

0 comments on commit a2615d8

Please sign in to comment.