Skip to content

Commit cfa9447

Browse files
committed
fix: update core gem to show transaction id in error message
1 parent 38f192f commit cfa9447

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ Result: "<response returned by service>"
268268
```
269269

270270
### Transaction IDs
271-
Every SDK call will return a response which will contain a transaction ID, accessible via the `x-global-transaction-id` header. This transaction ID is useful for troubleshooting and accessing relevant logs from your service instance.
272271

272+
Every SDK call will return a response which will contain a transaction ID, accessible via the `x-global-transaction-id` header. This transaction ID is useful for troubleshooting and accessing relevant logs from your service instance.
273273

274274
```ruby
275275
require "ibm_watson"
@@ -280,11 +280,13 @@ assistant = AssistantV1.new(
280280
version: "2017-04-21"
281281
)
282282

283-
response = assistant.headers(
284-
"Custom-Header" => "custom_value"
285-
).list_workspaces
286-
287-
p "Global Transaction Id: #{response.headers["X-Global-Transaction-Id"]}"
283+
begin
284+
response = assistant.list_workspaces
285+
p "Global transaction id: #{response.headers["X-Global-Transaction-Id"]}"
286+
rescue IBMCloudSdkCore::ApiException => e
287+
# Global transaction on failed api call is contained in the error message
288+
print "Error: ##{e}"
289+
end
288290
```
289291

290292
## Configuring the HTTP client

ibm_watson.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
3636
spec.add_runtime_dependency "eventmachine", "~> 1.2"
3737
spec.add_runtime_dependency "faye-websocket", "~> 0.10"
3838
spec.add_runtime_dependency "http", "~> 4.1.0"
39-
spec.add_runtime_dependency "ibm_cloud_sdk_core", "~> 1.1"
39+
spec.add_runtime_dependency "ibm_cloud_sdk_core", "~> 1.1.1"
4040
spec.add_runtime_dependency "jwt", "~> 2.2.1"
4141

4242
spec.add_development_dependency "bundler", "~> 1.16"

0 commit comments

Comments
 (0)