Changeset 212

Show
Ignore:
Timestamp:
12/28/07 19:50:41 (1 year ago)
Author:
chris
Message:

Make DatabaseException? always log itself and always adopt the original
exception's stack trace, if any, since it should always be used this way.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lex/trunk/src/com/qwirx/db/DatabaseException.java

    r152 r212  
    66 */ 
    77package com.qwirx.db; 
     8 
     9import org.apache.log4j.Logger; 
    810 
    911/** 
     
    1719        private final String message, query; 
    1820        private final Exception original; 
     21    private static final Logger LOG = Logger.getLogger(DatabaseException.class);  
    1922         
    2023    public DatabaseException(String message, Exception original, String query)  
     
    2326        this.query    = query; 
    2427        this.original = original; 
     28        LOG.error(message, original); 
     29        if (original != null) 
     30        { 
     31                setStackTrace(original.getStackTrace()); 
     32        } 
    2533    } 
    2634