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

[fix] catch dropbox api malformed_path exception and log file path with traceback #4332

Merged
merged 1 commit into from Oct 27, 2017

Conversation

saurabh6790
Copy link
Member

@rmehta
Copy link
Member

rmehta commented Oct 17, 2017

No way to fix the path??

else:
dropbox_client.files_upload_session_append(f.read(chunk_size), cursor.session_id,cursor.offset)
cursor.offset = f.tell()
except dropbox.exceptions.ApiError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are catching all API Errors!

@saurabh6790
Copy link
Member Author

@rmehta Updated.

dropbox_client.files_upload_session_append(f.read(chunk_size), cursor.session_id,cursor.offset)
cursor.offset = f.tell()
except dropbox.exceptions.ApiError as e:
if isinstance(e.error, dropbox.files.UploadError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will have to import dropbox.files first, no?

Also why on directly except dropbox.files.UloadError: ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • you will have to import dropbox.files first, no?
    we have imported dropbox package, we can use directly

  • Also why on directly except dropbox.files.UloadError:
    As per dropbox docstring, in case of the exception, the method raises UploadError.

@rmehta rmehta merged commit 1cf3c33 into frappe:develop Oct 27, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants