Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

@SetsCookie causes RestClientErrorHandling to stop working on non-200 reponses #971

Closed
colinfindlay-nz opened this issue Apr 20, 2014 · 1 comment

Comments

@colinfindlay-nz
Copy link

Without @SetsCookie the code generates

    try {
            restTemplate.exchange(etc....
    } catch (RestClientException e) {

With a @SetsCookie you get:

    ResponseEntity<LoginResult> response = restTemplate.exchange(etc...
    String[] requestedCookies = cookie setting code....
    try {
        return response.getBody();
    } catch (RestClientException e) {

So - if a REST service returns a non-200 HTTP code - your error handling is skipped.

@yDelouis
Copy link
Contributor

This issue is a duplicate of #914 and has been fixed by #915.
You should use the snapshot version if you want to have the fix.

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

No branches or pull requests

2 participants