summaryrefslogtreecommitdiffstats
path: root/clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/errors/OperationNotSupportedForUnitException.java
blob: abc55d68bc68576cb2514464aa0ffda5d9aa0495 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.utils.staterestapi.errors;

import java.util.Arrays;
import java.util.List;

public class OperationNotSupportedForUnitException extends StateRestApiException {

    private static String createMessage(List<String> path, String description) {
        return new StringBuilder()
                .append(Arrays.toString(path.toArray())).append(": ").append(description)
                .toString();
    }

    public OperationNotSupportedForUnitException(List<String> path, String description) {
        super(createMessage(path, description));
        setHtmlCode(405);
        setHtmlStatus("Operation not supported for resource");
    }

}