001 /* 002 // $Id: //open/util/resgen/src/org/eigenbase/xom/AssertFailure.java#3 $ 003 // Package org.eigenbase.xom is an XML Object Mapper. 004 // Copyright (C) 2005-2005 The Eigenbase Project 005 // Copyright (C) 2005-2005 Disruptive Tech 006 // Copyright (C) 2005-2005 LucidEra, Inc. 007 // Portions Copyright (C) 2000-2005 Kana Software, Inc. and others. 008 // 009 // This library is free software; you can redistribute it and/or modify it 010 // under the terms of the GNU Lesser General Public License as published by the 011 // Free Software Foundation; either version 2 of the License, or (at your 012 // option) any later version approved by The Eigenbase Project. 013 // 014 // This library is distributed in the hope that it will be useful, 015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 017 // GNU Lesser General Public License for more details. 018 // 019 // You should have received a copy of the GNU Lesser General Public License 020 // along with this library; if not, write to the Free Software 021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 022 // 023 // jhyde, 3 December, 2001 024 */ 025 026 package org.eigenbase.xom; 027 028 /** 029 * todo: 030 * 031 * @author jhyde 032 * @since 3 December, 2001 033 * @version $Id: //open/util/resgen/src/org/eigenbase/xom/AssertFailure.java#3 $ 034 **/ 035 public class AssertFailure extends RuntimeException { 036 /** Construct an AssertFailure with no message */ 037 public AssertFailure() { 038 super(); 039 } 040 041 /** Construct an AssertFailure with a simple detail message. */ 042 public AssertFailure(String s) { 043 super(s); 044 } 045 046 /** Construct an AssertFailure from an exception. This indicates an 047 * unexpected exception of another type. We'll fill in the stack trace 048 * when printing the message. */ 049 public AssertFailure(Throwable th) { 050 super("unexpected exception:\n" + 051 th.fillInStackTrace().toString()); 052 } 053 054 /** Similar to the previous constructor, except allows a custom message on 055 * top of the exception */ 056 public AssertFailure(Throwable th, String s) { 057 super(s + ":\n" + 058 th.fillInStackTrace().toString()); 059 } 060 } 061 062 // End AssertFailure.java