Commit cfe0b96559e4bdf34d7f35487ae4063d3377c953

Authored by Luis Pedro
1 parent 1476f22d73
Exists in master and in 1 other branch API_v3.0

C5076

src/main/java/org/um/dsi/gavea/orcid/client/BaseOrcidOAuthClient.java
... ... @@ -82,7 +82,7 @@ public class BaseOrcidOAuthClient implements Serializable {
82 82 Response response = target.request(OrcidConstants.APPLICATION_ORCID_XML).post(Entity.form(formData));
83 83 _log.debug("[getAccessTokens][post].[Response.Status] " + response.getStatus());
84 84 _log.debug("[getAccessTokens][post].[Response.Reason] " + response.getStatusInfo().getReasonPhrase());
85   -
  85 +
86 86 exceptionBuilder(response);
87 87  
88 88 return response;
... ... @@ -190,9 +190,11 @@ public class BaseOrcidOAuthClient implements Serializable {
190 190 if (response.getStatus() > 300) {
191 191 if (response.getStatus() == 400) {
192 192 Error error = response.readEntity(Error.class);
193   - throw new OrcidClientException(error.getResponseCode(), error.getUserMessage(), error.getErrorCode(), error.getDeveloperMessage());
  193 + throw new OrcidClientException(error.getResponseCode(), error.getUserMessage(), error.getErrorCode(),
  194 + error.getDeveloperMessage());
194 195 } else
195   - throw new OrcidClientException(response.getStatus(), response.getStatus() + " - " + response.getStatusInfo().getReasonPhrase());
  196 + throw new OrcidClientException(response.getStatus(),
  197 + response.getStatus() + " - " + response.getStatusInfo().getReasonPhrase());
196 198 }
197 199 }
198 200  
... ...
src/main/java/org/um/dsi/gavea/orcid/client/OrcidOAuthClient.java
... ... @@ -203,7 +203,7 @@ public class OrcidOAuthClient extends BaseOrcidOAuthClient {
203 203 public Fundings readFundingsSummary(final OrcidAccessToken token) throws OrcidClientException {
204 204 Response response = null;
205 205 try {
206   - response = get(OrcidConstants.ENDPOINT_FUNDINGS, token, null);
  206 + response = get(OrcidConstants.ENDPOINT_FUNDING, token, null);
207 207  
208 208 return response.readEntity(Fundings.class);
209 209 } finally {
... ...