Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch previously uncaught exception #88

Conversation

mymatenige
Copy link
Contributor

@mymatenige mymatenige commented Apr 10, 2020

There is an exception being thrown that is not currently caught in the code. Under high resource usage I can receive the following exception. I've made a fix that resolves this. I've tried to keep the fix inline with existing handling within the codebase.

Example stack trace below. Line numbers may not match entirely due to local edits.

Traceback (most recent call last):
  File "/usr/local/bin/dropbox", line 646, in __readline
    toret = self.f.readline().rstrip("\n")
  File "/usr/lib64/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/dropbox", line 1597, in <module>
    ret = main(sys.argv)
  File "/usr/local/bin/dropbox", line 1586, in main
    result = commands[argv[i]](argv[i+1:])
  File "/usr/local/bin/dropbox", line 746, in newmeth
    return meth(*n, **kw)
  File "/usr/local/bin/dropbox", line 1014, in filestatus
    status = dc.icon_overlay_file_status(path=fp).get('status', ['unknown'])[0]
  File "/usr/local/bin/dropbox", line 717, in __spec_command
    return self.send_command(str(name), kw)
  File "/usr/local/bin/dropbox", line 674, in send_command
    ok = self.__readline() == "ok"
  File "/usr/local/bin/dropbox", line 648, in __readline
    raise DropboxCommand.BadConnectionError()
__main__.BadConnectionError

@nikhilm
Copy link
Contributor

nikhilm commented Apr 10, 2020

Duplicate of #89

@nikhilm nikhilm marked this as a duplicate of #89 Apr 10, 2020
@nikhilm nikhilm closed this Apr 10, 2020
@mymatenige
Copy link
Contributor Author

@nikhilm #88 is not a duplicate of #89. The exception is thrown from a different place and the fix is different. Can you please re-review #88?

@nikhilm nikhilm reopened this Apr 10, 2020
@nikhilm nikhilm merged commit 0c1e4d6 into dropbox:master Apr 10, 2020
@nikhilm
Copy link
Contributor

nikhilm commented Apr 10, 2020

My apologies. The title and the stack were very similar. Thanks!

@mymatenige
Copy link
Contributor Author

Brilliant - thank you!

@mymatenige mymatenige deleted the bugfix-missed-bad-connection-error-filestatus branch April 10, 2020 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants