Skip to content

Commit

Permalink
Fix XO errors
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Sep 11, 2018
1 parent be35295 commit b7952bf
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 89 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ TuyaDevice.prototype.get = function (options) {
} else {
resolve(data.dps['1']);
}
}).catch(err => {
reject(err);
}).catch(error => {
reject(error);
});
});
};
Expand Down Expand Up @@ -225,8 +225,8 @@ TuyaDevice.prototype.set = function (options) {
return new Promise((resolve, reject) => {
this._send(this.device.ip, buffer).then(() => {
resolve(true);
}).catch(err => {
reject(err);
}).catch(error => {
reject(error);
});
});
};
Expand Down
2 changes: 1 addition & 1 deletion lib/cipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TuyaCipher.prototype.decrypt = function (data) {
// otherwise return as string.
try {
return JSON.parse(result);
} catch (err) {
} catch (error) {
return result;
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/message-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ MessageParser.prototype._decode = function () {
// If error, return as string.
try {
return JSON.parse(this._data);
} catch (err) { // Data is encrypted
} catch (error) { // Data is encrypted
return this._data.toString('ascii');
}
};
Expand Down
Loading

0 comments on commit b7952bf

Please sign in to comment.