diff --git a/packages/dd-trace/src/profiling/exporters/agent.js b/packages/dd-trace/src/profiling/exporters/agent.js index 13310d82770..b34ab3c9d94 100644 --- a/packages/dd-trace/src/profiling/exporters/agent.js +++ b/packages/dd-trace/src/profiling/exporters/agent.js @@ -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 } diff --git a/packages/dd-trace/test/profiling/exporters/agent.spec.js b/packages/dd-trace/test/profiling/exporters/agent.spec.js index a1878f0579f..7c42ad2af41 100644 --- a/packages/dd-trace/test/profiling/exporters/agent.spec.js +++ b/packages/dd-trace/test/profiling/exporters/agent.spec.js @@ -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