Skip to content

Commit adfbb2b

Browse files
author
David Kiss
committed
fix(trace-reporter): fixing retry on status code 409
1 parent 9e0de09 commit adfbb2b

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

lib/reporters/trace.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@ TraceReporter.prototype.getService = function(callback) {
6767
} catch (ex) {
6868
return callback(ex);
6969
}
70-
return callback(null, res);
71-
});
72-
})
73-
.on('error', function (err) {
74-
if (err.status === 409) {
70+
if (res.statusCode === 409) {
7571
return _this.getService(callback);
76-
} else {
77-
return callback(err);
7872
}
73+
return callback(null, res);
7974
});
75+
})
76+
.on('error', callback);
8077

8178
req.write(JSON.stringify({
8279
name: _this.appName

0 commit comments

Comments
 (0)