[Webfunds-commits] java/webfunds/utils Panic.java

Jeroen C. van Gelderen gelderen@cypherpunks.ai
Sun, 4 Jun 2000 14:29:49 -0400 (AST)


gelderen    00/06/04 14:29:48

  Added:       webfunds/utils Panic.java
  Log:
  Panic error. Should be thrown when you need to exit the application without
  performing cleanup.

Revision  Changes    Path
1.1                  java/webfunds/utils/Panic.java

Index: Panic.java
===================================================================
/* $Id: Panic.java,v 1.1 2000/06/04 18:29:48 gelderen Exp $
 *
 * Copyright (c) 2000 Systemics Inc. on behalf of
 * The WebFunds Development Team. All rights reserved.
 */
package webfunds.utils;


/**
 * A Panic object can be thrown when a non-recoverable error occurs and
 * the application requires a clean and immediate shutdown.
 *
 * For now the Panic error will execute System.exit(1) upon construction.
 * In the future we may catch Panic in main(...) and do the exit there.
 *
 * XXX: We may want to extend Throwable instead of Error but Jikes doesn't
 *      really grok that.
 *
 * @version $Revision: 1.1 $
 * @author  Jeroen C. van Gelderen (gelderen@webfunds.org)
 */
public final class Panic extends Error
{
    public Panic(String msg)
    {
        super(msg);
        System.out.println("PANIC: " + this.getMessage());
        System.out.print("Stack Trace: ");
        this.printStackTrace(System.out);
        System.exit(1);
    }
}