Skip to content

Commit

Permalink
Updating to handle case with missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
hgoscenski committed Feb 13, 2024
1 parent 1a1e2ac commit 8c73680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wyze-api",
"version": "1.1.4",
"version": "1.1.5",
"description": "An unoficial API wrapper for Wyze products.",
"homepage": "https://github.com/jfarmer08/wyze-api",
"main": "./src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ module.exports = class WyzeAPI {
throw e;
}

if (result.data.code != 1) {
if (result.data.code && result.data.code != 1) {
this.log.debug(`Potentially recoverable error during request, '${result.data.msg}'`)
throw new Error("Potentially recoverable error during request");
}
Expand Down

0 comments on commit 8c73680

Please sign in to comment.