Skip to content

Commit

Permalink
fix(platform): handle axios errors
Browse files Browse the repository at this point in the history
- Handle Axios Errors on `fetch()` properly
  • Loading branch information
johannrichard committed Nov 22, 2020
1 parent ae71f85 commit 5758901
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/platform.ts
Expand Up @@ -869,7 +869,7 @@ export class DingzDaHomebridgePlatform implements DynamicPlatformPlugin {
method: 'POST',
token: token,
body: callbackUrl,
});
}).catch(this.handleError.bind(this));
});
}

Expand Down Expand Up @@ -958,7 +958,7 @@ export class DingzDaHomebridgePlatform implements DynamicPlatformPlugin {
url: deviceInfoUrl,
returnBody: true,
token,
});
}).catch(this.handleError.bind(this));
}

static async fetch({
Expand Down Expand Up @@ -990,8 +990,6 @@ export class DingzDaHomebridgePlatform implements DynamicPlatformPlugin {
return response.status;
}
});
// FIXME: #103 Error handler at the wrong place
// .catch(this.handleError.bind(this));
return data;
}

Expand Down

0 comments on commit 5758901

Please sign in to comment.