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
2 changed files with 7 additions and 2 deletions
+5
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;