diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-04-13 17:21:42 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-04-13 17:22:48 +0200 |
commit | 396a45f892c989ce65bfcc04a6e8da26742a0caf (patch) | |
tree | 5363cf0cc6ccc868166b86529219f51995aba480 /orchestrator | |
parent | 5d99eeefabb8ff58e0b6125cccb1430a521b5390 (diff) |
Rename class to follow convention of similar exception types
Diffstat (limited to 'orchestrator')
3 files changed, 9 insertions, 9 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java index 4fecbefaffd..c706aed1143 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java @@ -77,11 +77,11 @@ public class ApplicationSuspensionRequestHandler extends RestApiRequestHandler<A try { status = orchestrator.getApplicationInstanceStatus(appId); } catch (ApplicationIdNotFoundException e) { - throw new RestApiException.NotFoundException("Application " + applicationIdString + " could not be found", e); + throw new RestApiException.NotFound("Application " + applicationIdString + " could not be found", e); } if (status.equals(ApplicationInstanceStatus.NO_REMARKS)) { - throw new RestApiException.NotFoundException("Application " + applicationIdString + " is not suspended"); + throw new RestApiException.NotFound("Application " + applicationIdString + " is not suspended"); } return new EmptyResponse(Status.NO_CONTENT); } @@ -107,7 +107,7 @@ public class ApplicationSuspensionRequestHandler extends RestApiRequestHandler<A orchestrator.suspend(applicationId); } catch (ApplicationIdNotFoundException e) { log.log(Level.INFO, "ApplicationId " + applicationIdString + " not found.", e); - throw new RestApiException.NotFoundException(e); + throw new RestApiException.NotFound(e); } catch (ApplicationStateChangeDeniedException e) { log.log(Level.INFO, "Suspend for " + applicationIdString + " failed.", e); throw new RestApiException.Conflict(); @@ -136,7 +136,7 @@ public class ApplicationSuspensionRequestHandler extends RestApiRequestHandler<A orchestrator.resume(applicationId); } catch (ApplicationIdNotFoundException e) { log.log(Level.INFO, "ApplicationId " + applicationIdString + " not found.", e); - throw new RestApiException.NotFoundException(e); + throw new RestApiException.NotFound(e); } catch (ApplicationStateChangeDeniedException e) { log.log(Level.INFO, "Suspend for " + applicationIdString + " failed.", e); throw new RestApiException.Conflict(); diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java index 4dcd76cbb10..7b28925205f 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java @@ -94,7 +94,7 @@ public class HostRequestHandler extends RestApiRequestHandler<HostRequestHandler throw restApiExceptionFromTimeout("getHost", hostName, e); } catch (HostNameNotFoundException e) { log.log(Level.FINE, "Host not found: " + hostName); - throw new RestApiException.NotFoundException(e); + throw new RestApiException.NotFound(e); } } @@ -117,7 +117,7 @@ public class HostRequestHandler extends RestApiRequestHandler<HostRequestHandler orchestrator.setNodeStatus(hostName, state); } catch (HostNameNotFoundException e) { log.log(Level.FINE, "Host not found: " + hostName); - throw new RestApiException.NotFoundException(e); + throw new RestApiException.NotFound(e); } catch (UncheckedTimeoutException e) { log.log(Level.FINE, "Failed to patch " + hostName + ": " + e.getMessage()); throw restApiExceptionFromTimeout("patch", hostName, e); @@ -151,7 +151,7 @@ public class HostRequestHandler extends RestApiRequestHandler<HostRequestHandler orchestrator.suspend(hostName); } catch (HostNameNotFoundException e) { log.log(Level.FINE, "Host not found: " + hostName); - throw new RestApiException.NotFoundException(e); + throw new RestApiException.NotFound(e); } catch (UncheckedTimeoutException e) { log.log(Level.FINE, "Failed to suspend " + hostName + ": " + e.getMessage()); throw restApiExceptionFromTimeout("suspend", hostName, e); @@ -174,7 +174,7 @@ public class HostRequestHandler extends RestApiRequestHandler<HostRequestHandler orchestrator.resume(hostName); } catch (HostNameNotFoundException e) { log.log(Level.FINE, "Host not found: " + hostName); - throw new RestApiException.NotFoundException(e); + throw new RestApiException.NotFound(e); } catch (UncheckedTimeoutException e) { log.log(Level.FINE, "Failed to resume " + hostName + ": " + e.getMessage()); throw restApiExceptionFromTimeout("resume", hostName, e); diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java index 8642a51b804..567013e7453 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java @@ -99,7 +99,7 @@ public class InstanceRequestHandler extends RestApiRequestHandler<InstanceReques ApplicationInstance applicationInstance = serviceMonitor.getApplication(instanceId) - .orElseThrow(RestApiException.NotFoundException::new); + .orElseThrow(RestApiException.NotFound::new); HostInfos hostInfos = statusService.getHostInfosByApplicationResolver().apply(applicationInstance.reference()); TreeMap<HostName, WireHostInfo> hostStatusMap = |