Skip to content

Commit 15d6619

Browse files
committed
Add exception information to the InternalErrorResponse stringification
1 parent 44bbcc1 commit 15d6619

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/datadog/core/transport/response.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ def internal_error?
5555
true
5656
end
5757

58+
def to_s
59+
"#{super}, error_type:#{error.class} error:#{error}"
60+
end
61+
5862
def inspect
5963
"#{super}, error_type:#{error.class} error:#{error}"
6064
end

spec/datadog/core/transport/response_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,10 @@
6868

6969
it { is_expected.to be true }
7070
end
71+
72+
describe '#to_s' do
73+
it 'includes the causing exception' do
74+
expect(response.to_s).to match(/StandardError/)
75+
end
76+
end
7177
end

0 commit comments

Comments
 (0)