1 22 23 package org.xquark.mapper; 24 25 import org.xquark.xml.xdbc.XMLDBCException; 26 31 public class RepositoryException extends XMLDBCException 32 { 33 private static final String RCSRevision = "$Revision: 1.2 $"; 34 private static final String RCSName = "$Name: $"; 35 37 public static final int PERMISSION_DENIED = 2; 38 39 public static final int ACCESS_REFUSED = 3; 40 41 public static final int ALREADY_EXISTS = 4; 42 43 public static final int PARSER_ERROR = 5; 44 45 public static final int CONSISTENCY_ERROR = 6; 46 47 public static final int SAX_OUTPUT_ERROR = 7; 48 49 public static final int DATA_LOSS = 8; 50 51 public static final int EXTRA_DATA_LOSS = 9; 52 53 public static final int NOT_EXISTS = 10; 54 55 public static final int ILLEGAL_EXPRESSION = 11; 56 57 public static final int NOT_IMPLEMENTED = 12; 58 59 public static final short NOT_ALLOWED = 13; 60 61 public static final int DB_CONSISTENCY_ERROR = 14; 62 63 public static final int INTERNAL_ERROR = 15; 64 65 public static final int SYSTEM_ERROR = 16; 66 67 public static final int MAPPING_CONSISTENCY_ERROR = 17; 68 69 public static final int XQUARK_CONF = 18; 70 71 public static final int DB_WARNING = 19; 72 73 public static final int SCHEMA_ERROR = 20; 74 75 public static final int NO_INIT = 21; 76 77 public static final int READ_ONLY = 22; 78 79 public static final int USER_ABORT = 23; 80 81 public static final int DB_ERROR = 24; 82 83 public static final int OUT_OF_RANGE = 25; 84 85 90 public RepositoryException(int code, String message) 91 { 92 super(code, message); 93 } 94 95 102 public RepositoryException(int code, String message, Throwable underlyingException) 103 { 104 super(code, message, underlyingException); 105 } 106 107 111 public String toString() { 113 String message = "XQuark Storage exception : " + super.getMessage(); 114 if ((exception != null) && 115 ((errorCode == DB_ERROR) || (errorCode == PARSER_ERROR) 116 || (errorCode == SAX_OUTPUT_ERROR) || (errorCode == SYSTEM_ERROR))) 117 message += "\nUnderlying exception : " + exception.getMessage(); 118 return message; 119 } 120 121 123 public void printStackTrace() 124 { 125 if (exception != null) 126 exception.printStackTrace(); 127 else 128 super.printStackTrace(); 129 } 130 } 131 | Popular Tags |