Package: ClientInitializationException
ClientInitializationException
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ClientInitializationException(String) |
|
|
|
|
|
||||||||||||||||||||
ClientInitializationException(Throwable, String) |
|
|
|
|
|
||||||||||||||||||||
getReason() |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2020, 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 {@link ElasticsearchClient} fails to initialize.
19: *
20: * @since 1.3.0
21: */
22: public class ClientInitializationException 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 exception.
32: * @since 1.3.0
33: */
34: public ClientInitializationException(String reason) {
35: this(null, reason);
36:
37: }
38:
39:
40: /**
41: * Constructor.
42: *
43: * @param cause The root {@link Throwable} of this {@link ClientInitializationException}.
44: * @param reason The reason of the exception.
45: * @since 1.3.0
46: */
47: public ClientInitializationException(Throwable cause, String reason) {
48: super(ClientErrorCodes.CLIENT_INITIALIZATION_ERROR, cause);
49:
50: this.reason = reason;
51: }
52:
53: /**
54: * Gets the reason of the initialization error.
55: *
56: * @return The reason of the initialization error.
57: * @since 1.3.0
58: */
59: public String getReason() {
60: return reason;
61: }
62: }