diff --git a/changelog/1.1.2_2022-02-01/bugfix-ocs-reject b/changelog/1.1.2_2022-02-01/bugfix-ocs-reject new file mode 100644 index 000000000..a8e274659 --- /dev/null +++ b/changelog/1.1.2_2022-02-01/bugfix-ocs-reject @@ -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 diff --git a/package.json b/package.json index 857a688fa..2ae0bf4b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "owncloud-sdk", - "version": "1.1.1", + "version": "1.1.2", "description": "ownCloud client library for JavaScript", "keywords": [ "owncloud", diff --git a/src/helperFunctions.js b/src/helperFunctions.js index 579e78ddd..cd879f8f2 100644 --- a/src/helperFunctions.js +++ b/src/helperFunctions.js @@ -301,6 +301,9 @@ class helpers { data: tree }) }) + .catch(e => { + return reject(e) + }) }) }