Skip to content

Commit fd0f699

Browse files
committed
writer is called, its the telemetry that doesnt happen
1 parent 5aed458 commit fd0f699

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/dd-trace/test/exporters/agent/writer.spec.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,23 @@ function describeWriter (protocolVersion) {
147147
})
148148
})
149149

150+
it('should log request errors', done => {
151+
const error = new Error('boom')
152+
error.status = 42
153+
154+
request.yields(error)
155+
156+
encoder.count.returns(1)
157+
writer.flush()
158+
159+
setTimeout(() => {
160+
expect(log.error)
161+
.to.have.been.calledWith('Error sending payload to the agent (status code: %s)',
162+
error.status, error, log.MUTE)
163+
done()
164+
})
165+
})
166+
150167
it('should update sampling rates', (done) => {
151168
encoder.count.returns(1)
152169
writer.flush(() => {

0 commit comments

Comments
 (0)