Stop retrying message send on 400 response

This commit is contained in:
Fedor Indutny 2022-05-23 09:27:40 -07:00 committed by GitHub
parent 3aa958533b
commit 5c72c785a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -731,6 +731,11 @@ export function _shouldFailSend(error: unknown, logId: string): boolean {
// SendMessageChallengeError
// MessageError
if (isRecord(error) && typeof error.code === 'number') {
if (error.code === 400) {
logError('Invalid request, failing.');
return true;
}
if (error.code === 401) {
logError('Permissions error, failing.');
return true;