mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Improve logging in RemoteDCRClient
This commit is contained in:
parent
9a7093a0f7
commit
e04a60104d
@ -83,9 +83,10 @@ public class RemoteDCRClient {
|
|||||||
String responseString = EntityUtils.toString(responseData, DynamicClientWebAppRegistrationConstants.
|
String responseString = EntityUtils.toString(responseData, DynamicClientWebAppRegistrationConstants.
|
||||||
CharSets.CHARSET_UTF8);
|
CharSets.CHARSET_UTF8);
|
||||||
if (status != 201) {
|
if (status != 201) {
|
||||||
throw new DynamicClientRegistrationException(
|
String msg = "Backend server error occurred while invoking DCR endpoint for " +
|
||||||
"Backend server error occurred while invoking DCR endpoint for " +
|
"registering service-provider upon web-app : '" + clientName + "'; Server returned response '" +
|
||||||
"registering service-provider for web-app : " + clientName);
|
responseString + "' with HTTP status code '" + status + "'";
|
||||||
|
throw new DynamicClientRegistrationException(msg);
|
||||||
}
|
}
|
||||||
return getOAuthApplicationInfo(gson.fromJson(responseString, JsonElement.class));
|
return getOAuthApplicationInfo(gson.fromJson(responseString, JsonElement.class));
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
@ -102,7 +103,9 @@ public class RemoteDCRClient {
|
|||||||
" registering service-provider for web-app : " + clientName,
|
" registering service-provider for web-app : " + clientName,
|
||||||
e);
|
e);
|
||||||
} finally {
|
} finally {
|
||||||
httpClient.close();
|
if (httpClient != null) {
|
||||||
|
httpClient.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +136,9 @@ public class RemoteDCRClient {
|
|||||||
throw new DynamicClientRegistrationException("Exception occurred while constructing the URI for invoking " +
|
throw new DynamicClientRegistrationException("Exception occurred while constructing the URI for invoking " +
|
||||||
"DCR endpoint for unregistering the web-app : " + appName, e);
|
"DCR endpoint for unregistering the web-app : " + appName, e);
|
||||||
} finally {
|
} finally {
|
||||||
httpClient.close();
|
if (httpClient != null) {
|
||||||
|
httpClient.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user