Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Reject promise when network request fails in OCS #977

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/1.1.2_2022-02-01/bugfix-ocs-reject
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Graceful reject for failing network request in OCS

When the network request inside a _makeOCSrequest failed it terminated the entire application instead of rejecting the promise. We now catch errors on the network request and reject the promise so that applications have a chance to handle the error.

https://github.com/owncloud/owncloud-sdk/pull/977
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "owncloud-sdk",
"version": "1.1.1",
"version": "1.1.2",
"description": "ownCloud client library for JavaScript",
"keywords": [
"owncloud",
Expand Down
3 changes: 3 additions & 0 deletions src/helperFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ class helpers {
data: tree
})
})
.catch(e => {
return reject(e)
})
})
}

Expand Down