Commit c09b5e16fe09a21ae6c87e994f13c526e9d4f0cd

Authored by Luis Pedro
1 parent 6307f31fda
Exists in master and in 1 other branch API_v3.0

C5064

src/main/java/org/um/dsi/gavea/orcid/client/BaseOrcidOAuthClient.java
@@ -11,9 +11,9 @@ import javax.ws.rs.core.MediaType; @@ -11,9 +11,9 @@ import javax.ws.rs.core.MediaType;
11 import javax.ws.rs.core.MultivaluedMap; 11 import javax.ws.rs.core.MultivaluedMap;
12 import javax.ws.rs.core.Response; 12 import javax.ws.rs.core.Response;
13 13
  14 +import org.glassfish.jersey.client.ClientProperties;
14 import org.slf4j.Logger; 15 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory; 16 import org.slf4j.LoggerFactory;
16 -import org.glassfish.jersey.client.ClientProperties;  
17 import org.um.dsi.gavea.orcid.client.constants.OrcidConstants; 17 import org.um.dsi.gavea.orcid.client.constants.OrcidConstants;
18 import org.um.dsi.gavea.orcid.client.exception.OrcidClientException; 18 import org.um.dsi.gavea.orcid.client.exception.OrcidClientException;
19 import org.um.dsi.gavea.orcid.client.util.RecordUtil; 19 import org.um.dsi.gavea.orcid.client.util.RecordUtil;
@@ -189,6 +189,8 @@ public class BaseOrcidOAuthClient implements Serializable { @@ -189,6 +189,8 @@ public class BaseOrcidOAuthClient implements Serializable {
189 } 189 }
190 190
191 protected void exceptionBuilder(Response response) throws OrcidClientException { 191 protected void exceptionBuilder(Response response) throws OrcidClientException {
  192 + Error error = new Error();
  193 +
192 if (response.getStatus() > 300) { 194 if (response.getStatus() > 300) {
193 if (response.getStatus() == 400) { 195 if (response.getStatus() == 400) {
194 Error error = response.readEntity(Error.class); 196 Error error = response.readEntity(Error.class);