Skip to content

Commit

Permalink
fix: 🐛 catch getMincraft errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Matix-Media committed Mar 17, 2024
1 parent eb0ed0c commit ddbfc21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/util/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ export function fromToken(
refresh?: boolean,
): null | Minecraft | Promise<Minecraft> {
if (validate(token) && refresh)
return new Promise(async (done) => {
return new Promise(async (done, reject) => {
const xbl = await auth.refresh(token.refresh);
done(await xbl.getMinecraft());
try {
done(await xbl.getMinecraft());
} catch (e) {
reject(e);
}
});
let mc = new Minecraft(
token.mcToken,
Expand Down

0 comments on commit ddbfc21

Please sign in to comment.