homey-api 1.5.11 → 1.5.12

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.
@@ -0,0 +1,21 @@
1
+ /* eslint-disable camelcase */
2
+
3
+ 'use strict';
4
+
5
+ const APIError = require('./APIError');
6
+
7
+ /**
8
+ * @class
9
+ * @hideconstructor
10
+ * @extends APIError
11
+ * @memberof HomeyAPI
12
+ */
13
+ class APIErrorTimeout extends APIError {
14
+
15
+ constructor(message, statusCode = 408) {
16
+ super(message, statusCode);
17
+ }
18
+
19
+ }
20
+
21
+ module.exports = APIErrorTimeout;
package/lib/Util.js CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  'use strict';
4
4
 
5
+ const APIErrorTimeout = require('./APIErrorTimeout');
6
+
5
7
  /**
6
8
  * Helper Utility Class
7
9
  * @class
@@ -43,7 +45,7 @@ class Util {
43
45
  * @returns {Promise}
44
46
  */
45
47
  static async timeout(promise, timeoutMillis = 5000, message = `Timeout after ${timeoutMillis}ms`) {
46
- const timeoutError = new Error(message);
48
+ const timeoutError = new APIErrorTimeout(message);
47
49
  let timeoutRef;
48
50
  return Promise.race([
49
51
  promise,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homey-api",
3
- "version": "1.5.11",
3
+ "version": "1.5.12",
4
4
  "description": "Homey API",
5
5
  "main": "src/index.js",
6
6
  "types": "assets/types/homey-api.d.ts",