Avoid giving false positive errors when buffers are updating

This commit is contained in:
Manuel Cortez 2021-02-10 09:34:30 -06:00
parent 9cb6eafbbc
commit 2f263a23b7

View File

@ -1326,16 +1326,19 @@ class Controller(object):
i.start_stream() i.start_stream()
else: else:
i.start_stream(play_sound=False) i.start_stream(play_sound=False)
except TweepError: except TweepError as err:
buff = self.view.search(i.name, i.account) 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))
i.remove_buffer(force=True) # Determine if this error was caused by a block applied to the current user (IE permission errors).
commonMessageDialogs.blocked_timeline() if err.api_code != None: # A twitter error, so safely try to remove the buffer.
if self.get_current_buffer() == i: buff = self.view.search(i.name, i.account)
self.right() i.remove_buffer(force=True)
self.view.delete_buffer(buff) commonMessageDialogs.blocked_timeline()
self.buffers.remove(i) if self.get_current_buffer() == i:
del i self.right()
continue self.view.delete_buffer(buff)
self.buffers.remove(i)
del i
continue
if change_title: if change_title:
pub.sendMessage("buffer-title-changed", buffer=i) pub.sendMessage("buffer-title-changed", buffer=i)