1 22 23 package org.enhydra.spi.conf.util; 24 25 36 public class ConfigException extends Exception { 37 43 public static final int UNKNOWN = 0; 44 45 52 public static final int NOT_FOUND = 1; 53 54 61 public static final int SYNTAX = 2; 62 63 70 public static final int COUNT = 3; 71 72 79 public static final int FORMAT = 4; 80 81 87 private static final int MAX_REASON = 4; 88 89 97 public int reason; 98 99 105 public 106 ConfigException() 107 { 108 super("Unknown reason"); 109 reason = UNKNOWN; 110 } 111 112 120 public 121 ConfigException(String s) 122 { 123 super(s); 124 reason = UNKNOWN; 125 } 126 127 135 public ConfigException (Throwable cause) { 136 super (cause); 137 } 138 139 148 public ConfigException (String msg, Throwable cause) { 149 super (msg,cause); 150 } 151 152 161 public 162 ConfigException(int r, String s) 163 { 164 super(s); 165 if ((r < 0) || (r > MAX_REASON)) reason = UNKNOWN; 166 else reason = r; 167 } 168 } 169 | Popular Tags |