File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -667,6 +667,7 @@ t.test("it logs when failed to report event", async () => {
667667 "Starting agent..." ,
668668 "Found token, reporting enabled!" ,
669669 "Heartbeat..." ,
670+ "Failed to do heartbeat" ,
670671 ] ) ;
671672} ) ;
672673
Original file line number Diff line number Diff line change @@ -208,14 +208,11 @@ export class Agent {
208208 this . attackLogger . log ( attack ) ;
209209
210210 if ( this . token ) {
211- this . api
212- . report ( this . token , attack , this . timeoutInMS )
213- . then ( ( response ) => this . checkForReportingAPIError ( response ) )
214- . catch ( ( err ) => {
215- console . error (
216- `Aikido: Failed to report attack event to Aikido platform: ${ err . message } `
217- ) ;
218- } ) ;
211+ this . api . report ( this . token , attack , this . timeoutInMS ) . catch ( ( err ) => {
212+ console . error (
213+ `Aikido: Failed to report attack event to Aikido platform: ${ err . message } `
214+ ) ;
215+ } ) ;
219216 }
220217 }
221218
@@ -224,9 +221,7 @@ export class Agent {
224221 */
225222 private heartbeat ( timeoutInMS = this . timeoutInMS ) {
226223 this . sendHeartbeat ( timeoutInMS ) . catch ( ( err ) => {
227- console . error (
228- `Aikido: Failed to send heartbeat event to Aikido platform: ${ err . message } `
229- ) ;
224+ this . logger . log ( "Failed to do heartbeat" ) ;
230225 } ) ;
231226 }
232227
@@ -313,7 +308,6 @@ export class Agent {
313308 timeoutInMS
314309 ) ;
315310
316- this . checkForReportingAPIError ( response ) ;
317311 this . updateServiceConfig ( response ) ;
318312 }
319313 }
You can’t perform that action at this time.
0 commit comments