blob: 60953495bd97a64b1764ceb5d7326b5804f58c4b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright Vespa.ai. 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.List;
public class MissingUnitException extends StateRestApiException {
private static String createMessage(List<String> path, int level) {
StringBuilder sb = new StringBuilder();
sb.append("No such resource '");
for (int i=0; i<=level; ++i) {
if (i != 0) sb.append('/');
sb.append(path.get(i));
}
return sb.append("'.").toString();
}
public MissingUnitException(List<String> path, int level) {
super(createMessage(path, level), 404, null);
}
}
|