Skip to content

Commit

Permalink
clearer profiling error
Browse files Browse the repository at this point in the history
Indicating that a backoff has expired isn't enough information to
diagnose what's causing the backoff in the first place, so rather than
creating a new error object, this change just passes the last error
along.
  • Loading branch information
bengl committed Sep 11, 2024
1 parent bd85572 commit d3960fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/dd-trace/src/profiling/exporters/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class AgentExporter {
this._logger.error(`Error from the agent: ${err.message}`)
return
} else if (err) {
reject(new Error('Profiler agent export back-off period expired'))
reject(err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/test/profiling/exporters/agent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe('exporters/agent', function () {
try {
await exporter.export({ profiles, start, end, tags })
} catch (err) {
expect(err.message).to.match(/^Profiler agent export back-off period expired$/)
expect(err.message).to.match(/^HTTP Error 500$/)
failed = true
}
expect(failed).to.be.true
Expand Down

0 comments on commit d3960fa

Please sign in to comment.