aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/errors/StateRestApiException.java
blob: 9c67d36eee3aa1b113c53f0496de59fa9560c97f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.utils.staterestapi.errors;

public abstract class StateRestApiException extends Exception {
    private Integer htmlCode;
    private String htmlStatus;

    public StateRestApiException(String description) {
        super(description);
    }

    /**
     * If given, this HTML code is set in the response. If not given, a value will
     * be autogenerated to fit.
     */
    public StateRestApiException setHtmlCode(int code) {
        htmlCode = code;
        return this;
    }

    /**
     * If given, this HTML status string is set in the response. If not given, a value will
     * be autogenerated to fit.
     */
    public StateRestApiException setHtmlStatus(String status) {
        htmlStatus = status;
        return this;
    }

    public Integer getCode() { return htmlCode; }
    public String getStatus() { return htmlStatus; }
}