return null instead of throwing an error

This commit is contained in:
m5r 2022-07-02 01:49:53 +02:00
parent aeda74dcf8
commit 05cd1c410a

View File

@ -19,7 +19,10 @@ const loader: LoaderFunction = async ({ request }) => {
const twilioAccount = await db.twilioAccount.findUnique({ where: { accountSid: twilio.accountSid } });
if (!twilioAccount || !twilioAccount.twimlAppSid) {
throw new Error("unreachable");
logger.warn(
"Twilio account is connected but the background jobs didn't run properly, this shouldn't be happening",
);
return null;
}
const twilioClient = getTwilioClient(twilioAccount);