Hi all.

Has anyone written a Logger wrapper whose error() methods return a Throwable? I have a class that translates SQLExceptions into more generic exceptions, all of which extend a base exception class (e.g. StoredProcedureNotFoundException extends DataAccessException). I would like to have one class do my logging, exception translation, and have it return the new exception. This would be cleaner than performing all of these steps in my catch blocks, as in:

catch (SQLException e)
{
            DataAccessException dae =
                    translator.translate("QueryJdbcFacade.executeQuery()",
                                         null,
                                         e);
            logger.error("Throwing exception: " +
                         dae.toString() +
                         "...",
                         dae);
            throw dae;
}

It would be even nicer if I could use the wrapper in concert with an object renderer to create my own custom message format.

Thanks,

Bob Pepersack


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to