Better error handling
parent
66d28e4e75
commit
4549da9ba3
|
@ -23,11 +23,15 @@ export default function checkSS(client: Client) {
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!hash) return;
|
if (!hash) return;
|
||||||
|
try {
|
||||||
const { status } = error.response;
|
const { status } = error.response;
|
||||||
if (status === 400 || status === 401 || status === 403 || status === 404) {
|
if (status === 400 || status === 401 || status === 403 || status === 404) {
|
||||||
await client.db.Account.updateOne({ userID }, { $set: { hash: false } });
|
await client.db.Account.updateOne({ userID }, { $set: { hash: false } });
|
||||||
client.getDMChannel(userID).then((channel) => channel.createMessage('Your SecureSign password has been reset - please reinitialize your SecureSign account. Run `=securesign init` for more information')).catch();
|
client.getDMChannel(userID).then((channel) => channel.createMessage('Your SecureSign password has been reset - please reinitialize your SecureSign account. Run `=securesign init` for more information')).catch();
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in New Issue