Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit e89d9de

Browse files
Richard BlaylockMario
authored andcommitted
1211 Add description for the convertToOAuthException method.
1 parent dd64358 commit e89d9de

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

extensions/servlet/src/main/java/com/stormpath/sdk/servlet/mvc/AccessTokenController.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,16 @@ protected AccessTokenResult stormpathFactorChallengeAuthenticationRequest(HttpSe
337337
return createAccessTokenResult(request, response, authenticationResult);
338338
}
339339

340-
private OAuthException convertToOAuthException(ResourceException e, OAuthErrorCode defaultErrorCode) {
341-
com.stormpath.sdk.error.Error error = e.getStormpathError();
340+
/**
341+
* Takes a {@link ResourceException ResourceException} thrown when retrieving an oauth token and exposes
342+
* select fields from its Error to be returned as an {@link OAuthException OAuthException}.
343+
*
344+
* @param resourceException the ResourceException to convert
345+
* @param defaultErrorCode the OAuthErrorCode to use in case none is supplied in the underlying Error
346+
* @return an OAuthException exposing select fields depending on the value of the action property
347+
*/
348+
private OAuthException convertToOAuthException(ResourceException resourceException, OAuthErrorCode defaultErrorCode) {
349+
com.stormpath.sdk.error.Error error = resourceException.getStormpathError();
342350
String message = error.getMessage();
343351

344352
OAuthErrorCode oauthError = defaultErrorCode;

0 commit comments

Comments
 (0)