diff options
author | aunsane <aunsane@gmail.com> | 2017-04-26 22:38:46 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-04-26 22:38:46 +0300 |
commit | 63be74b050de2eebc52c3bd38b3bd9b42d6bfe66 (patch) | |
tree | ba6cde7d4abe2a81f77d8f69956fa77aba0360f2 /plugins/CloudFile/src/Services/dropbox_service.cpp | |
parent | f9d718fd63324bc808481287d7f8818099360d3f (diff) |
CloudFile: fix dropbox url generation
Diffstat (limited to 'plugins/CloudFile/src/Services/dropbox_service.cpp')
-rw-r--r-- | plugins/CloudFile/src/Services/dropbox_service.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index 2d308a28f8..409494e9d3 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -173,7 +173,15 @@ void CDropboxService::CreateSharedLink(const char *path, char *url) DropboxAPI::CreateSharedLinkRequest shareRequest(token, path); NLHR_PTR response(shareRequest.Send(hConnection)); - HandleHttpError(response); + if (response == NULL) + throw Exception(HttpStatusToError()); + + if (!HTTP_CODE_SUCCESS(response->resultCode) && + response->resultCode != HTTP_CODE_CONFLICT) { + if (response->dataLength) + throw Exception(response->pData); + throw Exception(HttpStatusToError(response->resultCode)); + } JSONNode root = JSONNode::parse(response->pData); if (root.isnull()) |