Skip to content

Commit c73dfec

Browse files
authored
Update OAuth.java
1 parent 15f0a05 commit c73dfec

File tree

1 file changed

+5
-2
lines changed
  • src/main/java/com/docusign/esign/client/auth

1 file changed

+5
-2
lines changed

src/main/java/com/docusign/esign/client/auth/OAuth.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ public synchronized void updateAccessToken() {
8585
throw new ClientHandlerException(e.getMessage(), e);
8686
}
8787
if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) {
88-
if (accessTokenResponse.getAccessToken() == null || accessTokenResponse.getExpiresIn() == null) {
89-
throw new ClientHandlerException("Error while requesting an access token: " + accessTokenResponse);
88+
if (accessTokenResponse.getAccessToken() == null) {
89+
throw new ClientHandlerException("Error while requesting an access token. No 'access_token' found.");
90+
}
91+
if (accessTokenResponse.getExpiresIn() == null) {
92+
throw new ClientHandlerException("Error while requesting an access token. No 'expires_in' found.");
9093
}
9194
setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn());
9295
if (accessTokenListener != null) {

0 commit comments

Comments
 (0)