jimm.evote
Class ErrorHandler

java.lang.Object
  extended byjimm.evote.ErrorHandler

public class ErrorHandler
extends java.lang.Object

A simple error message handler.

Though using Log4J makes perfect sense, I didn't want to add any dependencies to this application code.


Constructor Summary
ErrorHandler()
           
 
Method Summary
static void error(java.lang.Exception e)
          Prints an exception's error message; does not exit.
static void error(java.lang.Exception e, boolean exit)
          Prints an exception's error message to System.err and exits if exit is true.
static void error(java.lang.String msg)
          Prints msg to System.err; does not exit.
static void error(java.lang.String msg, boolean exit)
          Prints msg to System.err and exits if exit is true.
static void error(java.lang.String msg, java.lang.Exception e)
          Prints msg and an exception's error message to System.err; does not exit.
static void error(java.lang.String msg, java.lang.Exception e, boolean exit)
          Prints msg and an exception's error message to System.err and exits if exit is true.
static void error(java.lang.String msg, OperationStatus status)
          Prints optional msg and printable version of status; does not exit.
static void error(java.lang.String msg, OperationStatus status, boolean exit)
          Prints optional msg and printable version of status and optionally exits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorHandler

public ErrorHandler()
Method Detail

error

public static void error(java.lang.Exception e)
Prints an exception's error message; does not exit.

Parameters:
e - an exception

error

public static void error(java.lang.Exception e,
                         boolean exit)
Prints an exception's error message to System.err and exits if exit is true.

Parameters:
e - an exception
exit - if true, exits after printing msg

error

public static void error(java.lang.String msg)
Prints msg to System.err; does not exit.

Parameters:
msg - an error message

error

public static void error(java.lang.String msg,
                         boolean exit)
Prints msg to System.err and exits if exit is true.

Parameters:
msg - an error message
exit - if true, exits after printing msg

error

public static void error(java.lang.String msg,
                         java.lang.Exception e)
Prints msg and an exception's error message to System.err; does not exit.

Parameters:
msg - an error message
e - an exception

error

public static void error(java.lang.String msg,
                         java.lang.Exception e,
                         boolean exit)
Prints msg and an exception's error message to System.err and exits if exit is true.

Parameters:
msg - an error message
e - an exception
exit - if true, exits after printing msg

error

public static void error(java.lang.String msg,
                         OperationStatus status)
Prints optional msg and printable version of status; does not exit.

Parameters:
msg - an optional message; may be null
status - a database operation status code

error

public static void error(java.lang.String msg,
                         OperationStatus status,
                         boolean exit)
Prints optional msg and printable version of status and optionally exits.

Parameters:
msg - an optional message; may be null
status - a database operation status code
exit - if true, exits after printing


Copyright (c) 2004 by Jim Menard jimm@io.com