Skip to content

Package: ClientUnavailableException

ClientUnavailableException

nameinstructionbranchcomplexitylinemethod
ClientUnavailableException(String)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
ClientUnavailableException(Throwable, String)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getReason()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.elasticsearch.client.exception;
14:
15: import org.eclipse.kapua.service.elasticsearch.client.ElasticsearchClient;
16:
17: /**
18: * {@link ClientException} to throw when che {@link ElasticsearchClient} is not available.
19: *
20: * @since 1.0.0
21: */
22: public class ClientUnavailableException extends ClientException {
23:
24: private static final long serialVersionUID = 2211521053876589804L;
25:
26: private final String reason;
27:
28: /**
29: * Constructor.
30: *
31: * @param reason The reason of the {@link ClientUnavailableException}.
32: * @since 1.3.0
33: */
34: public ClientUnavailableException(String reason) {
35: super(ClientErrorCodes.CLIENT_UNAVAILABLE, null, reason);
36:
37: this.reason = reason;
38: }
39:
40: /**
41: * Constructor.
42: *
43: * @param cause The root {@link Throwable} of this {@link ClientUnavailableException}.
44: * @param reason The reason of the {@link ClientUnavailableException}.
45: * @since 1.3.0
46: */
47: public ClientUnavailableException(Throwable cause, String reason) {
48: super(ClientErrorCodes.CLIENT_UNAVAILABLE, cause, reason);
49:
50: this.reason = reason;
51: }
52:
53: /**
54: * Gets the reason of the {@link ClientUnavailableException}.
55: *
56: * @return The reason of the {@link ClientUnavailableException}.
57: * @since 1.3.0
58: */
59: public String getReason() {
60: return reason;
61: }
62: }