-
Notifications
You must be signed in to change notification settings - Fork 23
/
ConfigException.java
43 lines (38 loc) · 1.13 KB
/
ConfigException.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
package uk.ac.starlink.ttools.plot2.config;
/**
* Exception thrown when a configuration input value is not suitable.
*
* @author Mark Taylor
* @since 26 Feb 2013
*/
public class ConfigException extends Exception {
private final ConfigKey<?> key_;
/**
* Constructor with chained exception.
*
* @param key key whose value was being solicited when the error occurred
* @param msg error message, may reference value but should not name key
* @param cause chained exception, if any
*/
public ConfigException( ConfigKey<?> key, String msg, Throwable cause ) {
super( msg, cause );
key_ = key;
}
/**
* Constructor.
*
* @param key key whose value was being solicited when the error occurred
* @param msg error message, may reference value but should not name key
*/
public ConfigException( ConfigKey key, String msg ) {
this( key, msg, null );
}
/**
* Returns the key whose value this exception applies to.
*
* @return config key
*/
public ConfigKey<?> getConfigKey() {
return key_;
}
}