Skip to content

Commit

Permalink
chore: use error format
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlimes committed May 14, 2024
1 parent 0111a52 commit e73342d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/fetchServerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ export default async function fetchServerInfo(invite) {
{
headers: {
authentication: `Bot ${process.env.DC_TOKEN}`,
"User-Agent": "DiscordBot (https://github.com/gitlimes/discord-md-badge, v2.0.0)"
"User-Agent":
"DiscordBot (https://github.com/gitlimes/discord-md-badge, v2.0.0)",
},
}
);

if (!serverFetch.ok) {
console.log("not ok...", JSON.stringify(await serverFetch.json()));
return { error: `fetch error, potentially ratelimited?\ncode: ${serverFetch.status}` };
}

const server = await serverFetch.json();
Expand Down

0 comments on commit e73342d

Please sign in to comment.