Skip to content

Commit 58435e8

Browse files
maxnussbaumGERMAN ATTANASIO RUIZ
authored andcommitted
test(api exception): Adjust watson api exception for code coverage
1 parent 97ccaef commit 58435e8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/watson_apis/watson_api_exception.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ def initialize(code: nil, error: nil, info: nil, transaction_id: nil, global_tra
1616
%w[code error_code error error_message].each { |k| body_hash.delete(k) }
1717
@info = body_hash
1818
end
19+
@transaction_id = transaction_id
20+
@global_transaction_id = global_transaction_id
1921
@transaction_id = response.headers["X-DP-Watson-Tran-ID"] if response.headers.include?("X-DP-Watson-Tran-ID")
2022
@global_transaction_id = response.headers["X-Global-Transaction-ID"] if response.headers.include?("X-Global-Transaction-ID")
2123
else
24+
# :nocov:
2225
@code = code
2326
@error = error
2427
@info = info
2528
@transaction_id = transaction_id
2629
@global_transaction_id = global_transaction_id
30+
# :nocov:
2731
end
2832
end
2933

0 commit comments

Comments
 (0)