Further unit tests: getVar()
[cfb.git] / prod / net / jaekl / cfb / store / StoreException.java
1 package net.jaekl.cfb.store;
2
3 import java.util.Arrays;
4
5 import net.jaekl.cfb.CfbException;
6
7 public class StoreException extends CfbException {
8         public enum Type {
9                 UNKNOWN_PATTERN,        // bug pattern type is not found in the message collection 
10                 UNKNOWN_CATEGORY,       // bug category is not found in the message collection
11                 INVALID_LOC_ID,         // the specified location ID is not found in the database
12                 INVALID_VAR_ID          // the specified variable ID is not found in the database
13         }
14         
15         private Type m_type;
16         private String[] m_info;
17         
18         private static final long serialVersionUID = 1L;
19         
20         public StoreException(Type type, String... info) {
21                 super();
22                 
23                 m_type = type;
24                 m_info = info;
25         }
26         
27         public StoreException(Throwable cause, Type type, String... info) {
28                 super(cause);
29                 
30                 m_type = type;
31                 m_info = info;
32         }
33         
34         public Type getType() { return m_type; }
35         
36         @Override
37         public String toString() {
38                 return "" + getClass().getName() + ": " + m_type + ": " + Arrays.toString(m_info);
39         }
40 }