tim@130: package de.intevation.gnv.geobackend.base.connectionpool.exception; tim@130: tim@130: import com.esri.sde.sdk.client.SeError; tim@130: import com.esri.sde.sdk.client.SeException; tim@130: tim@130: import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; tim@130: sascha@886: import org.apache.log4j.Logger; sascha@886: tim@130: /** tim@130: * The class lConnectionException fulfills the following purposes: tim@130: * tim@130: * @author blume sascha@887: * @author Tim Englich tim@130: */ tim@130: public class ConnectionException extends TechnicalException { tim@130: tim@130: /** tim@884: * The UID of this Class. tim@884: */ tim@884: private static final long serialVersionUID = 102459262123219617L; tim@884: tim@884: /** tim@130: * Default Logging instance tim@130: */ tim@130: private static Logger sLogger = Logger.getLogger(ConnectionException.class); tim@130: tim@130: /** tim@130: * Constructs a new exception with null as its detail message. tim@130: * The cause is not initialized, and may subsequently be initialized by a tim@130: * call to {@link #initCause}. tim@130: */ tim@130: public ConnectionException() { tim@130: } tim@130: tim@130: /** tim@130: * Constructs a new exception with the specified detail message. The tim@130: * cause is not initialized, and may subsequently be initialized by tim@130: * a call to {@link #initCause}. tim@130: * tim@130: * @param message the detail message. The detail message is saved for tim@130: * later retrieval by the {@link #getMessage()} method. tim@130: */ tim@130: public ConnectionException(String message) { tim@130: super(message); tim@130: } tim@884: tim@884: /** tim@884: * Constructor tim@884: * @param pCause the Throwable which cause this exception tim@884: */ tim@130: public ConnectionException(Throwable pCause) { tim@130: super(pCause); tim@130: } tim@130: tim@130: /** tim@130: * Constructs a new exception with the specified detail message and tim@130: * cause.

Note that the detail message associated with tim@130: * cause is not automatically incorporated in tim@130: * this exception's detail message. tim@130: * tim@130: * @param message the detail message (which is saved for later retrieval tim@130: * by the {@link #getMessage()} method). tim@130: * @param cause the cause (which is saved for later retrieval by the tim@130: * {@link #getCause()} method). (A null value is tim@130: * permitted, and indicates that the cause is nonexistent or tim@130: * unknown.) tim@130: * @since 1.4 tim@130: */ tim@130: public ConnectionException(String message, Throwable cause) { tim@130: super(message, cause); tim@130: } tim@130: tim@130: /** tim@130: * Displays the details of an SeException (if available). tim@130: * tim@130: */ tim@130: public void printError() { tim@130: if (getCause() != null && getCause() instanceof SeException) { tim@130: SeException exception = (SeException) getCause(); tim@130: SeError error = exception.getSeError(); tim@130: tim@130: sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); tim@130: sLogger.debug(" Error Description : " + error.getErrDesc()); tim@130: tim@130: int extError = error.getExtError(); tim@130: if (extError != 0) tim@130: sLogger.debug(" Extended Error Number : " + extError); tim@130: tim@130: String desc = error.getSdeErrMsg(); tim@130: if (desc != null && desc.length() != 0) tim@130: sLogger.debug(" Extended Error Description : " + desc); tim@130: tim@130: desc = error.getExtErrMsg(); tim@130: if (desc != null && desc.length() != 0) tim@130: sLogger.debug(" Extended Error Description : " + desc); tim@130: tim@130: sLogger.debug(exception); tim@130: tim@130: } tim@130: tim@130: } tim@130: }