Skip to content

Commit

Permalink
Merge branch 'main' into fix/null-check
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward authored Feb 27, 2024
2 parents a2d40fc + 864daa8 commit 54dda0f
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,26 @@ export class Saturn {
return
}

const bandwidthLogs = this.hasPerformanceAPI
? this._matchLogsWithPerformanceMetrics(this.logs)
: this.logs

await fetch(
this.config.logURL,
{
method: 'POST',
body: JSON.stringify({ bandwidthLogs, logSender: this.config.logSender })
}
)
try {
const bandwidthLogs = this.hasPerformanceAPI
? this._matchLogsWithPerformanceMetrics(this.logs)
: this.logs

await fetch(
this.config.logURL,
{
method: 'POST',
body: JSON.stringify({ bandwidthLogs, logSender: this.config.logSender })
}
)
} catch (e) {
console.log(e)
throw e
} finally {
this.logs = []
this._clearPerformanceBuffer()
}

this.logs = []
this._clearPerformanceBuffer()
}

/**
Expand Down

0 comments on commit 54dda0f

Please sign in to comment.