/
KapuaConfigurationException.java
75 lines (66 loc) · 2.41 KB
/
KapuaConfigurationException.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************************
* Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Eurotech - initial API and implementation
*******************************************************************************/
package org.eclipse.kapua.commons.configuration.exception;
import org.eclipse.kapua.KapuaException;
/**
* Configuration exception.
*
* @since 1.0
*/
public class KapuaConfigurationException extends KapuaException {
private static final long serialVersionUID = -5191015333552703367L;
private static final String KAPUA_ERROR_MESSAGES = "kapua-configuration-service-error-messages";
/**
* Builds a new KapuaException instance based on the supplied KapuaErrorCode.
*
* @param code
*/
public KapuaConfigurationException(KapuaConfigurationErrorCodes code) {
super(code);
}
/**
* Builds a new KapuaException instance based on the supplied KapuaErrorCode
* and optional arguments for the associated exception message.
*
* @param code
* @param arguments
*/
public KapuaConfigurationException(KapuaConfigurationErrorCodes code, Object... arguments) {
super(code, arguments);
}
/**
* Builds a new KapuaAccountException instance based on the supplied KapuaAccountErrorCode,
* an Throwable cause, and optional arguments for the associated exception message.
*
* @param code
* @param cause
* @param arguments
*/
public KapuaConfigurationException(KapuaConfigurationErrorCodes code, Throwable cause, Object... arguments) {
super(code, cause, arguments);
}
/**
* Factory method to build an KapuaAccountException with the KapuaAccountErrorCode.INTERNAL_ERROR,
* and optional arguments for the associated exception message.
*
* @param message
* @return
*/
public static KapuaConfigurationException internalError(String message) {
return new KapuaConfigurationException(KapuaConfigurationErrorCodes.INTERNAL_ERROR, null, message);
}
@Override
protected String getKapuaErrorMessagesBundle() {
return KAPUA_ERROR_MESSAGES;
}
}