homey-api 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AthomCloudAPI/User.js +2 -1
- package/lib/Util.js +4 -3
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ const APIDefinition = require('../APIDefinition');
|
|
|
4
4
|
|
|
5
5
|
const Homey = require('./Homey');
|
|
6
6
|
const Device = require('./Device');
|
|
7
|
+
const APIErrorNotFound = require('../APIErrorNotFound');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* A user on {@link AthomCloudAPI}.
|
|
@@ -42,7 +43,7 @@ class User extends APIDefinition {
|
|
|
42
43
|
const homey = this.homeys.find(homey => homey.id === id);
|
|
43
44
|
|
|
44
45
|
if (!homey) {
|
|
45
|
-
throw new
|
|
46
|
+
throw new APIErrorNotFound(`Homey Not Found: ${id}`);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
return homey;
|
package/lib/Util.js
CHANGED
|
@@ -244,15 +244,16 @@ class Util {
|
|
|
244
244
|
.catch(err => {
|
|
245
245
|
rejections[i] = err;
|
|
246
246
|
|
|
247
|
-
if
|
|
248
|
-
|
|
247
|
+
// Check if all promises have been rejected
|
|
248
|
+
if (rejections.filter(Boolean).length === promises.length) {
|
|
249
|
+
reject(rejections);
|
|
249
250
|
}
|
|
250
251
|
});
|
|
251
252
|
});
|
|
252
253
|
});
|
|
253
254
|
}
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
/**
|
|
256
257
|
* Converts an object to a query string
|
|
257
258
|
* @param {object} queryObject - Query parameter object
|
|
258
259
|
* @returns {string}
|