improvement: better media filename handle

This commit is contained in:
canove
2020-08-04 10:07:03 -03:00
parent c0817e99d1
commit 7a99abe543
3 changed files with 8 additions and 8 deletions

View File

@@ -161,11 +161,9 @@ const wbotMessageListener = () => {
where: { id: msg.id.id },
});
if (!messageToUpdate) {
// will throw an error in frist ack if msg wast sent from cellphone
const error = new Error(
"Erro ao alterar o ack da mensagem no banco de dados"
);
error.statusCode = 501;
// will throw an error if msg was sent from cellphone
const error = new Error("No message with this ID found in database");
error.statusCode = 404;
throw error;
}
await messageToUpdate.update({ ack: ack });