@Override
    public HttpResponse handle(HttpRequest request) {
        log.log(Level.FINE, () -> request.getMethod() + " " + request.getUri().toString());
        try {
            return switch (request.getMethod()) {
                case POST -> handlePOST(request);
                case GET -> handleGET(request);
                case PUT -> handlePUT(request);
                case DELETE -> handleDELETE(request);
                default -> createErrorResponse(request.getMethod());
            };
        } catch (NotFoundException | com.yahoo.vespa.config.server.NotFoundException e) {
            return HttpErrorResponse.notFoundError(getMessage(e, request));
        } catch (ActivationConflictException e) {
            return HttpErrorResponse.conflictWhenActivating(getMessage(e, request));
        } catch (InvalidApplicationException e) {
            return HttpErrorResponse.invalidApplicationPackage(getMessage(e, request));
        } catch (IllegalArgumentException | UnsupportedOperationException e) {
            return HttpErrorResponse.badRequest(getMessage(e, request));
        } catch (NodeAllocationException e) {
            return e.retryable() ? HttpErrorResponse.nodeAllocationFailure(getMessage(e, request))
                                 : HttpErrorResponse.invalidApplicationPackage(getMessage(e, request));
        } catch (InternalServerException e) {
            return HttpErrorResponse.internalServerError(getMessage(e, request));
        } catch (UnknownVespaVersionException e) {
            return HttpErrorResponse.unknownVespaVersion(getMessage(e, request));
        } catch (RequestTimeoutException e) {
            return HttpErrorResponse.requestTimeout(getMessage(e, request));
        } catch (ApplicationLockException e) {
            return HttpErrorResponse.applicationLockFailure(getMessage(e, request));
        } catch (ParentHostUnavailableException e) {
            return HttpErrorResponse.parentHostNotReady(getMessage(e, request));
        } catch (RequestedNodesMissingException e) {
            return HttpErrorResponse.requestedNodesMissing(getMessage(e, request));
        } catch (CertificateNotReadyException e) {
            return HttpErrorResponse.certificateNotReady(getMessage(e, request));
        } catch (ConfigNotConvergedException e) {
            return HttpErrorResponse.configNotConverged(getMessage(e, request));
        } catch (LoadBalancerServiceException e) {
            return HttpErrorResponse.loadBalancerNotReady(getMessage(e, request));
        } catch (ReindexingStatusException e) {
            return HttpErrorResponse.reindexingStatusUnavailable(getMessage(e, request));
        } catch (PreconditionFailedException e) {
            return HttpErrorResponse.preconditionFailed(getMessage(e, request));
        } catch (QuotaExceededException e) {
            return HttpErrorResponse.quotaExceeded(getMessage(e, request));
        } catch (Exception e) {
            log.log(Level.WARNING, "Unexpected exception handling a config server request", e);
            return HttpErrorResponse.internalServerError(getMessage(e, request));
        }
    }
Super class for http handlers, that takes care of checking valid
methods for a request. Handlers should subclass this method and
implement the handleMETHOD methods that it supports.

@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java