Skip to content

Commit

Permalink
Merge pull request kubernetes-client#292 from gflarity/gflarity/watch…
Browse files Browse the repository at this point in the history
…_errors

improve error handling in watch by checking response
  • Loading branch information
k8s-ci-robot authored Jun 28, 2019
2 parents a34e8f9 + fe631f4 commit ad25705
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export class Watch {
const req = this.requestImpl.webRequest(requestOptions, (error, response, body) => {
if (error) {
done(error);
} else if (response && response.statusCode !== 200) {
done(new Error(response.StatusMessage));
} else {
done(null);
}
Expand Down

0 comments on commit ad25705

Please sign in to comment.