Skip to content

Commit cf5be0b

Browse files
authored
fix: Send global errors when set in callbacks (#51)
1 parent e5b5efb commit cf5be0b

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

lib/callbacks/AccessTokenRequest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ module.exports = class AccessTokenRequest extends STBase {
2424
}
2525
};
2626

27+
if (this.globalError) {
28+
body.globalError = this.globalError
29+
}
30+
2731
const options = {
2832
method: 'POST',
2933
headers: {

lib/callbacks/DiscoveryRequest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ module.exports = class DiscoveryRequest extends STBase {
6464
devices: this.devices
6565
};
6666

67+
if (this.globalError) {
68+
body.globalError = this.globalError
69+
}
70+
6771
const options = {
6872
method: 'POST',
6973
headers: {

lib/callbacks/RefreshTokenRequest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ module.exports = class RefreshTokenRequest extends STBase {
2424
}
2525
};
2626

27+
if (this.globalError) {
28+
body.globalError = this.globalError
29+
}
30+
2731
const options = {
2832
method: 'POST',
2933
headers: {

lib/callbacks/StateUpdateRequest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ module.exports = class StateUpdateRequest extends STBase {
4545
deviceState: deviceState
4646
};
4747

48+
if (this.globalError) {
49+
body.globalError = this.globalError
50+
}
51+
4852
const options = {
4953
method: 'POST',
5054
headers: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "st-schema",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "SmartThings Schema for C2C integration",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)