[ 
https://issues.apache.org/jira/browse/OLTU-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14743403#comment-14743403
 ] 

Antonio Sargento commented on OLTU-135:
---------------------------------------

Well, I don't use this library anymore and I don't find my changes.
But, like I described on the issue text, since I remember, the only think that 
is necessary to do is "putting the return statement outside the try catch 
block".
Something like:

{code:title=org.apache.oltu.oauth2.httpclient4.HttpClient4.java|borderStyle=solid}
...
HttpResponse response = client.execute(req);
Header contentTypeHeader = null;
HttpEntity entity = response.getEntity();
if (entity != null) {
        responseBody = EntityUtils.toString(entity);
        contentTypeHeader = entity.getContentType();
}
String contentType = null;
if (contentTypeHeader != null) {
        contentType = contentTypeHeader.toString();
}
        
//return OAuthClientResponseFactory
//      .createCustomResponse(responseBody, contentType, 
response.getStatusLine().getStatusCode(),
//      responseClass);
} catch (Exception e) {
        throw new OAuthSystemException(e);
        }
return OAuthClientResponseFactory
        .createCustomResponse(responseBody, contentType, 
response.getStatusLine().getStatusCode(),
        responseClass); 
}
}
{code}



> OAuthProblemException are not propagates correctly in classe HttpClient4
> ------------------------------------------------------------------------
>
>                 Key: OLTU-135
>                 URL: https://issues.apache.org/jira/browse/OLTU-135
>             Project: Apache Oltu
>          Issue Type: Bug
>          Components: oauth2-httpclient4
>    Affects Versions: oauth2-0.31
>            Reporter: Antonio Sargento
>            Priority: Minor
>
> The HttpClient4 class has a try catch block that caches all Exceptions and 
> transforms them into OAuthSystemException. 
> Well, the OAuthProblemException are transformed too, which means that it is 
> not possible to propagate these kind of exceptions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to