blob: 1fe97fed2c7c7328f6565b610426db0a1d598a05 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.restapi.systemflags;
import java.util.OptionalInt;
/**
* @author bjorncs
*/
class FlagsClientException extends RuntimeException {
private final int responseCode;
FlagsClientException(int responseCode, String message) {
super(message);
this.responseCode = responseCode;
}
FlagsClientException(String message, Throwable cause) {
super(message, cause);
this.responseCode = -1;
}
OptionalInt responseCode() {
return responseCode > 0 ? OptionalInt.of(responseCode) : OptionalInt.empty();
}
}
|