b7d75816450814da88747a968314aa76e3dd4162
[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         }
13         
14         private Type m_type;
15         private String[] m_info;
16         
17         private static final long serialVersionUID = 1L;
18         
19         public StoreException(Type type, String... info) {
20                 super();
21                 
22                 m_type = type;
23                 m_info = info;
24         }
25         
26         public StoreException(Throwable cause, Type type, String... info) {
27                 super(cause);
28                 
29                 m_type = type;
30                 m_info = info;
31         }
32         
33         public Type getType() { return m_type; }
34         
35         @Override
36         public String toString() {
37                 return "" + getClass().getName() + ": " + m_type + ": " + Arrays.toString(m_info);
38         }
39 }