diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java index 3b4f6c61f2..9af8618eed 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/src/main/java/org/wso2/carbon/device/mgt/extensions/remote.session/RemoteSessionManagementServiceImpl.java @@ -110,12 +110,15 @@ public class RemoteSessionManagementServiceImpl implements RemoteSessionManageme + " , deviceId : " + deviceId); } } catch (OperationManagementException | InvalidDeviceException e) { - log.error("error", e); - throw new RemoteSessionManagementException("Error occurred while adding initial operation for the " + - "device Type : " + deviceType + " , deviceId : " + deviceId); + String msg = "Error occurred while adding initial operation for the " + + "device Type : " + deviceType + " , deviceId : " + deviceId; + log.error(msg, e); + throw new RemoteSessionManagementException(msg); } catch (DeviceAccessAuthorizationException e) { - throw new RemoteSessionManagementException("Error occurred while device access authorization for the " + - "device Type : " + deviceType + " , " + "deviceId : " + deviceId); + String msg = "Error occurred while device access authorization for the " + + "device Type : " + deviceType + " , " + "deviceId : " + deviceId; + log.error(msg, e); + throw new RemoteSessionManagementException(msg); } finally { PrivilegedCarbonContext.endTenantFlow(); }