Skip to content

feat: improve error handling for connection failures #335

@marythought

Description

@marythought

Recommendation: Enhance Java SDK error handling to catch connection failures and provide clearer messages. This requires changes to the SDK code itself, not documentation:

// Suggested enhancement in io.opentdf.platform.sdk.SDKBuilder
try {
    // existing connection code
} catch (StatusRuntimeException e) {
    if (e.getStatus().getCode() == Status.Code.UNAVAILABLE) {
        throw new SDKException(String.format(
            "Failed to connect to OpenTDF platform at %s. " +
            "Is the platform running? Verify with: curl -k %s/healthz",
            platformEndpoint, platformEndpoint
        ), e);
    }
    throw e;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions