/** * Creates an {@link OAuth2Exception} from a Map<String,String>. * * @param errorParams * @return */ public static OAuth2Exception valueOf(Map<String, String> errorParams) { String errorCode = errorParams.get(ERROR); String errorMessage = errorParams.containsKey(DESCRIPTION) ? errorParams.get(DESCRIPTION) : null; OAuth2Exception ex = create(errorCode, errorMessage); Set<Map.Entry<String, String>> entries = errorParams.entrySet(); for (Map.Entry<String, String> entry : entries) { String key = entry.getKey(); if (!ERROR.equals(key) && !DESCRIPTION.equals(key)) { ex.addAdditionalInformation(key, entry.getValue()); } } return ex; }
protected OAuth2Exception convertToExternal(JaxbOAuth2Exception jaxbOAuth2Exception) { return OAuth2Exception.create(jaxbOAuth2Exception.getErrorCode(), jaxbOAuth2Exception.getDescription()); } }
/** * Creates an {@link OAuth2Exception} from a Map<String,String>. * * @param errorParams * @return */ public static OAuth2Exception valueOf(Map<String, String> errorParams) { String errorCode = errorParams.get(ERROR); String errorMessage = errorParams.containsKey(DESCRIPTION) ? errorParams.get(DESCRIPTION) : null; OAuth2Exception ex = create(errorCode, errorMessage); Set<Map.Entry<String, String>> entries = errorParams.entrySet(); for (Map.Entry<String, String> entry : entries) { String key = entry.getKey(); if (!ERROR.equals(key) && !DESCRIPTION.equals(key)) { ex.addAdditionalInformation(key, entry.getValue()); } } return ex; }
protected OAuth2Exception convertToExternal(JaxbOAuth2Exception jaxbOAuth2Exception) { return OAuth2Exception.create(jaxbOAuth2Exception.getErrorCode(), jaxbOAuth2Exception.getDescription()); } }