Throw if error on sendSms
This commit is contained in:
parent
8f87c2696c
commit
7d871e7a58
|
@ -87,7 +87,6 @@ const runCron = async () => {
|
|||
const marginAccount = await client.getMarginAccount(connection, marginAccountPk, dexProgramId);
|
||||
const collateralRatio = marginAccount.getCollateralRatio(mangoGroups[alert.mangoGroupPk]['mangoGroup'], mangoGroups[alert.mangoGroupPk]['prices']);
|
||||
if ((100 * collateralRatio) <= alert.collateralRatioThresh) {
|
||||
console.log("Got an alert");
|
||||
let message = MESSAGE.replace('@ratio@', alert.collateralRatioThresh);
|
||||
message += marginAccount.toPrettyString(
|
||||
mangoGroups[alert.mangoGroupPk]['mangoGroup'],
|
||||
|
|
|
@ -58,9 +58,7 @@ const sendSms = (phoneNumber: string, message: string) => {
|
|||
from: config.twilioNumber,
|
||||
to: phoneNumber,
|
||||
body: message,
|
||||
})
|
||||
.then(message => console.log(message.sid))
|
||||
.catch(error => console.error(error))
|
||||
}).catch(error => { throw error })
|
||||
}
|
||||
|
||||
const sendEmail = (email: string, message: string) => {
|
||||
|
|
Loading…
Reference in New Issue