Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
loopion opened this issue Jan 20, 2022 · 0 comments
Open

Comments

@loopion
Copy link

loopion commented Jan 20, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant