@@ -38,16 +38,18 @@ public BackgroundException map(final TokenResponseException failure) {
3838 final TokenErrorResponse details = failure .getDetails ();
3939 if (null != details ) {
4040 this .append (buffer , details .getErrorDescription ());
41- switch (details .getError ()) {
42- // Error code "invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope"
43- case "invalid_client" :
44- case "invalid_request" :
45- case "unauthorized_client" :
46- case "unsupported_grant_type" :
47- case "invalid_scope" :
48- return new LoginFailureException (buffer .toString (), failure );
49- case "invalid_grant" :
50- return new ExpiredTokenException (buffer .toString (), failure );
41+ if (null != details .getError ()) {
42+ switch (details .getError ()) {
43+ // Error code "invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope"
44+ case "invalid_client" :
45+ case "invalid_request" :
46+ case "unauthorized_client" :
47+ case "unsupported_grant_type" :
48+ case "invalid_scope" :
49+ return new LoginFailureException (buffer .toString (), failure );
50+ case "invalid_grant" :
51+ return new ExpiredTokenException (buffer .toString (), failure );
52+ }
5153 }
5254 }
5355 return new DefaultHttpResponseExceptionMappingService ().map (new HttpResponseException (failure .getStatusCode (), buffer .toString ()));
0 commit comments