Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Java SDK Attempt to decrypt error 500 & then lose original error message #150

Open
@loopion

Description

@loopion

There is a bit of a red herring in that the processResponse of the HyperwalletApiClient (Hyperwallet SDK) will attempt to decrypt the error 500 and then lose the original error message.
The message did actually say that it could not find the key to use, but when the response comes back, it tries to decrypt the body then throws an exception that the body does not contain the dots!

Might be worth a future request to not attempt to decrypt error 500 responses!

  protected <T> T processResponse(final Response response, final Class<T> type)
            throws ParseException, JOSEException, IOException {
        checkErrorResponse(response);
        checkResponseHeader(response);
        **if (response.getResponseCode() == 204) {
            return convert("{}", type);
        } else {
            return convert(decryptResponse(response.getBody()), type);
        }**
    }

See file : src/main/java/com/hyperwallet/clientsdk/util/HyperwalletApiClient.java

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