Fix failover on failed sends, and improve logging

This commit is contained in:
Scott Nonnenberg 2023-06-20 17:06:38 -07:00 committed by GitHub
parent 5e9bbb42f1
commit 65b6d9c2bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 4 deletions

View file

@ -843,7 +843,14 @@ export function _shouldFailSend(error: unknown, logId: string): boolean {
if (error instanceof SendMessageProtoError) {
if (!error.errors || !error.errors.length) {
logError('SendMessageProtoError had no errors, failing.');
logError('SendMessageProtoError had no errors but was thrown! Failing.');
return true;
}
if (error.successfulIdentifiers && error.successfulIdentifiers.length > 0) {
logError(
'SendMessageProtoError had successful sends; no further sends needed. Failing.'
);
return true;
}