Source:
<code>public String getPublicRouter(PaasManagerUser user, String region, String publicNetworkId) throws OpenStackException { log.debug("Obtain public router for external netwrk " + publicNetworkId); if (publicNetworkId == null ) { String errorMessage = "There is not an external network valid for the router"; <START> log.error(errorMessage); <END> throw new OpenStackException(errorMessage); } String type = "router"; RegionCache regionCache = new RegionCache(); String routerId = regionCache.getUrl(region, type); if (routerId != null) { return routerId; } PaasManagerUser adminUser = openOperationUtil.getAdminUser(user); HttpUriRequest request = openOperationUtil.createQuantumGetRequest(RESOURCE_ROUTERS, APPLICATION_JSON, region, adminUser.getToken(), adminUser.getTenantId()); String response = null; try { response = openOperationUtil.executeNovaRequest(request); routerId = getPublicRouterId(response, adminUser.getUserName(), publicNetworkId); if (routerId == null) { String errorMessage = "It is not possible to find a public router for network " + publicNetworkId + ": "; log.error(errorMessage); throw new OpenStackException(errorMessage); } regionCache.putUrl(region, type, routerId); return routerId; } catch (OpenStackException e) { String errorMessage = "Error getting router for obtaining the public router: " + e; log.error(errorMessage); throw new OpenStackException(errorMessage); } catch (Exception e) { String errorMessage = "Error getting router from OpenStack for obtaining the public router: " + e; log.error(errorMessage); throw new OpenStackException(errorMessage); } }</code><technical_language>log error log warning</technical_language>

Target:
public String getPublicRouter(PaasManagerUser user, String region, String publicNetworkId) throws OpenStackException { log.debug("Obtain public router for external netwrk " + publicNetworkId); if (publicNetworkId == null ) { String errorMessage = "There is not an external network valid for the router"; log.warn(errorMessage); throw new OpenStackException(errorMessage); } String type = "router"; RegionCache regionCache = new RegionCache(); String routerId = regionCache.getUrl(region, type); if (routerId != null) { return routerId; } PaasManagerUser adminUser = openOperationUtil.getAdminUser(user); HttpUriRequest request = openOperationUtil.createQuantumGetRequest(RESOURCE_ROUTERS, APPLICATION_JSON, region, adminUser.getToken(), adminUser.getTenantId()); String response = null; try { response = openOperationUtil.executeNovaRequest(request); routerId = getPublicRouterId(response, adminUser.getUserName(), publicNetworkId); if (routerId == null) { String errorMessage = "It is not possible to find a public router for network " + publicNetworkId + ": "; log.error(errorMessage); throw new OpenStackException(errorMessage); } regionCache.putUrl(region, type, routerId); return routerId; } catch (OpenStackException e) { String errorMessage = "Error getting router for obtaining the public router: " + e; log.error(errorMessage); throw new OpenStackException(errorMessage); } catch (Exception e) { String errorMessage = "Error getting router from OpenStack for obtaining the public router: " + e; log.error(errorMessage); throw new OpenStackException(errorMessage); } }