ApiResponse. The SDK does not throw on API failures. Check status() before you use data().
On success, data() holds the resource. On failure, status() and message() describe what went wrong. error() holds structured Core error details when available. data() may hold Core’s raw error JSON or be null.
Parse the response
Read the envelope first. Usestatus() to classify the failure, then read the field that carries detail for that type.
How to handle errors
1
Check status
Confirm success before you use
data(). On every call, check that status() is in the 2xx range for the method you called.Error handling
2
Read the error detail
Use the field that matches the failure type:
- Core rejection (
status()is a Core HTTP error anddata()is set): readresponse.error().code()for the code Core returned. - SDK validation (
status() == 400anddata()isnull): readresponse.message()and fix the payload before retrying.
response.status() when you do not need code-level logic (401, 404, 409, 5xx).3
Configure transport handling
When the SDK cannot reach Core or the request times out, you get
status() 408 or 500 and data() null.Configure timeout and logging in your SDK client to investigate these failures.Core errors
When Core rejects a request, the SDK wraps the failure in anApiResponse. It sets status() to Core’s HTTP status, message() to the error message, data() to Core’s JSON error body, and error() to structured details parsed from error_detail.
On Core 0.15.0 and later, a rejected request looks like this:
404 Not Found
response.error().code(). Use response.status() to choose a broad response. Treat response.error().message() as display text; Core may change wording between releases. On older Core versions, response.error().code() may be UNKNOWN.
Client-side validation
Some methods validate input before sending a request. When validation fails, Core never receives the call.Transport failures
When the SDK cannot reach Core or the request times out, you getstatus() 408 or 500, data() null, and a message() describing the failure. Configure timeout and logging in Using the SDK.
When debugging transport failures, log status(), message(), and the endpoint you called.
Related docs
Using the SDK
Timeouts, retries, and logging.
0.15.0 migration
Error codes, inflight queuing, and reconciliation changes.
Quick start
Install the SDK and create your first transaction.
Changelog
Java SDK releases and version history.