diff --git a/src/main/java/com/xero/api/OAuthGetTemporaryToken.java b/src/main/java/com/xero/api/OAuthGetTemporaryToken.java index 1568f1c6..85249809 100644 --- a/src/main/java/com/xero/api/OAuthGetTemporaryToken.java +++ b/src/main/java/com/xero/api/OAuthGetTemporaryToken.java @@ -83,6 +83,10 @@ public final OAuthCredentialsResponse execute() throws IOException,XeroApiExcept UrlEncodedParser.parse(content, oauthResponse); int code = response.getStatusLine().getStatusCode(); + if (oauthResponse.token == null) { + XeroApiException e = new XeroApiException(400,content); + throw e; + } if (code != 200) { XeroApiException e = new XeroApiException(code,content); throw e; diff --git a/src/main/java/com/xero/api/XeroClientException.java b/src/main/java/com/xero/api/XeroClientException.java index e923875e..d25a0764 100644 --- a/src/main/java/com/xero/api/XeroClientException.java +++ b/src/main/java/com/xero/api/XeroClientException.java @@ -12,7 +12,6 @@ public class XeroClientException extends RuntimeException { * */ private static final long serialVersionUID = 1L; - /** * Create new exception. * @@ -31,5 +30,5 @@ public XeroClientException(String message) { public XeroClientException(String message, Throwable cause) { super(message, cause); } - + }