Mercurial > dive4elements > gnv-client
diff geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java @ 894:d674cef2ca0d
Using unix line endings only.
geo-backend/trunk@939 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 18 Apr 2010 09:22:38 +0000 |
parents | b757def3ff55 |
children | ebeb56428409 |
line wrap: on
line diff
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,103 +1,103 @@ -package de.intevation.gnv.geobackend.base.connectionpool.exception; - -import com.esri.sde.sdk.client.SeError; -import com.esri.sde.sdk.client.SeException; - -import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; - -import org.apache.log4j.Logger; - -/** - * The class <code>lConnectionException</code> fulfills the following purposes: - * - * @author blume - * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - */ -public class ConnectionException extends TechnicalException { - - /** - * The UID of this Class. - */ - private static final long serialVersionUID = 102459262123219617L; - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(ConnectionException.class); - - /** - * Constructs a new exception with <code>null</code> as its detail message. - * The cause is not initialized, and may subsequently be initialized by a - * call to {@link #initCause}. - */ - public ConnectionException() { - } - - /** - * Constructs a new exception with the specified detail message. The - * cause is not initialized, and may subsequently be initialized by - * a call to {@link #initCause}. - * - * @param message the detail message. The detail message is saved for - * later retrieval by the {@link #getMessage()} method. - */ - public ConnectionException(String message) { - super(message); - } - - /** - * Constructor - * @param pCause the Throwable which cause this exception - */ - public ConnectionException(Throwable pCause) { - super(pCause); - } - - /** - * Constructs a new exception with the specified detail message and - * cause. <p>Note that the detail message associated with - * <code>cause</code> is <i>not</i> automatically incorporated in - * this exception's detail message. - * - * @param message the detail message (which is saved for later retrieval - * by the {@link #getMessage()} method). - * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is - * permitted, and indicates that the cause is nonexistent or - * unknown.) - * @since 1.4 - */ - public ConnectionException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Displays the details of an SeException (if available). - * - */ - public void printError() { - if (getCause() != null && getCause() instanceof SeException) { - SeException exception = (SeException) getCause(); - SeError error = exception.getSeError(); - - sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); - sLogger.debug(" Error Description : " + error.getErrDesc()); - - int extError = error.getExtError(); - if (extError != 0) - sLogger.debug(" Extended Error Number : " + extError); - - String desc = error.getSdeErrMsg(); - if (desc != null && desc.length() != 0) - sLogger.debug(" Extended Error Description : " + desc); - - desc = error.getExtErrMsg(); - if (desc != null && desc.length() != 0) - sLogger.debug(" Extended Error Description : " + desc); - - sLogger.debug(exception); - - } - - } -} +package de.intevation.gnv.geobackend.base.connectionpool.exception; + +import com.esri.sde.sdk.client.SeError; +import com.esri.sde.sdk.client.SeException; + +import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; + +import org.apache.log4j.Logger; + +/** + * The class <code>lConnectionException</code> fulfills the following purposes: + * + * @author blume + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class ConnectionException extends TechnicalException { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 102459262123219617L; + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(ConnectionException.class); + + /** + * Constructs a new exception with <code>null</code> as its detail message. + * The cause is not initialized, and may subsequently be initialized by a + * call to {@link #initCause}. + */ + public ConnectionException() { + } + + /** + * Constructs a new exception with the specified detail message. The + * cause is not initialized, and may subsequently be initialized by + * a call to {@link #initCause}. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public ConnectionException(String message) { + super(message); + } + + /** + * Constructor + * @param pCause the Throwable which cause this exception + */ + public ConnectionException(Throwable pCause) { + super(pCause); + } + + /** + * Constructs a new exception with the specified detail message and + * cause. <p>Note that the detail message associated with + * <code>cause</code> is <i>not</i> automatically incorporated in + * this exception's detail message. + * + * @param message the detail message (which is saved for later retrieval + * by the {@link #getMessage()} method). + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A <tt>null</tt> value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + * @since 1.4 + */ + public ConnectionException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Displays the details of an SeException (if available). + * + */ + public void printError() { + if (getCause() != null && getCause() instanceof SeException) { + SeException exception = (SeException) getCause(); + SeError error = exception.getSeError(); + + sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); + sLogger.debug(" Error Description : " + error.getErrDesc()); + + int extError = error.getExtError(); + if (extError != 0) + sLogger.debug(" Extended Error Number : " + extError); + + String desc = error.getSdeErrMsg(); + if (desc != null && desc.length() != 0) + sLogger.debug(" Extended Error Description : " + desc); + + desc = error.getExtErrMsg(); + if (desc != null && desc.length() != 0) + sLogger.debug(" Extended Error Description : " + desc); + + sLogger.debug(exception); + + } + + } +}