Improve logging in RemoteDCRClient

revert-70aa11f8
prabathabey 9 years ago
parent 9a7093a0f7
commit e04a60104d

@ -83,9 +83,10 @@ public class RemoteDCRClient {
String responseString = EntityUtils.toString(responseData, DynamicClientWebAppRegistrationConstants.
CharSets.CHARSET_UTF8);
if (status != 201) {
throw new DynamicClientRegistrationException(
"Backend server error occurred while invoking DCR endpoint for " +
"registering service-provider for web-app : " + clientName);
String msg = "Backend server error occurred while invoking DCR endpoint for " +
"registering service-provider upon web-app : '" + clientName + "'; Server returned response '" +
responseString + "' with HTTP status code '" + status + "'";
throw new DynamicClientRegistrationException(msg);
}
return getOAuthApplicationInfo(gson.fromJson(responseString, JsonElement.class));
} catch (URISyntaxException e) {
@ -102,9 +103,11 @@ public class RemoteDCRClient {
" registering service-provider for web-app : " + clientName,
e);
} finally {
if (httpClient != null) {
httpClient.close();
}
}
}
public static boolean deleteOAuthApplication(String user, String appName, String clientid, String host)
throws DynamicClientRegistrationException {
@ -133,8 +136,10 @@ public class RemoteDCRClient {
throw new DynamicClientRegistrationException("Exception occurred while constructing the URI for invoking " +
"DCR endpoint for unregistering the web-app : " + appName, e);
} finally {
if (httpClient != null) {
httpClient.close();
}
}
return false;
}

Loading…
Cancel
Save