From 0065af2aef06b51e23fa51f9fc75df79ab36e92b Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 25 Feb 2021 16:57:32 -0600 Subject: [PATCH] Avoid removing buffers when api_error=130 --- src/controller/mainController.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index edb16c9a..9a8757c6 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -1329,7 +1329,8 @@ class Controller(object): except TweepError as err: log.exception("Error %s starting buffer %s on account %s, with args %r and kwargs %r due to the following reason: %s" % (err.api_code, i.name, i.account, i.args, i.kwargs, err.reason)) # Determine if this error was caused by a block applied to the current user (IE permission errors). - if err.api_code != None: # A twitter error, so safely try to remove the buffer. + errors_allowed = [130] + if err.api_code != None and err.api_code not in errors_allowed: # A twitter error, so safely try to remove the buffer. buff = self.view.search(i.name, i.account) i.remove_buffer(force=True) commonMessageDialogs.blocked_timeline() @@ -1538,7 +1539,8 @@ class Controller(object): except TweepError as err: log.exception("Error %s starting buffer %s on account %s, with args %r and kwargs %r due to the following reason: %s" % (err.api_code, i.name, i.account, i.args, i.kwargs, err.reason)) # Determine if this error was caused by a block applied to the current user (IE permission errors). - if err.api_code != None: # A twitter error, so safely try to remove the buffer. + errors_allowed = [130] + if err.api_code != None and err.api_code not in errors_allowed: # A twitter error, so safely try to remove the buffer. buff = self.view.search(i.name, i.account) i.remove_buffer(force=True) commonMessageDialogs.blocked_timeline()