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

Some methods were not updated to handle the new JSON error code & error message responses #22

Closed
logantracyo opened this issue Nov 24, 2020 · 1 comment
Assignees

Comments

@logantracyo
Copy link
Contributor

logantracyo commented Nov 24, 2020

One specific example:

    public String retryFailedInboundMessage(String id) throws PostmarkException, IOException {
        String response = execute(HttpClient.REQUEST_TYPES.PUT, getEndpointUrl(inboundMessagesEndpoint + id + "/retry"));
        return dataHandler.fromJson(response, String.class);
    }

Calling this method with a valid / retriable message ID results in a Jackson exception because response is now a JSON-encoded Object, not just a String value. It seems sane to keep the return type as String, by decoding the JSON response to BaseMessageResponse.class and returning the String value.

bypassInboundMessage() also should be updated -- and some of the other methods that return a generic HashMap seem like also using the BaseMessageResponse there might be a better choice (since they're also getting the Integer ErrorCode, String Message response) -- in which case returning BaseMessageResponse rather than BaseMessageResponse.getMessage() might be best.

I've added a PR, #21, in case that's of any help.

@ibalosh ibalosh self-assigned this Dec 7, 2020
@ibalosh
Copy link
Contributor

ibalosh commented Dec 8, 2020

Hi,

we just released new version 1.5.5 which should be available by maven in couple of minutes, which resolves this issue and adds new endpoints to the library.

Let us know if it works ok for you.

@ibalosh ibalosh closed this as completed Dec 8, 2020
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

2 participants