001/* 002 * jDTAUS Core API 003 * Copyright (C) 2005 Christian Schulte 004 * <cs@schulte.it> 005 * 006 * This library is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 2.1 of the License, or any later version. 010 * 011 * This library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with this library; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 019 * 020 */ 021package org.jdtaus.core.container; 022 023import java.util.Locale; 024 025/** 026 * Unrecoverable error thrown if no working {@code Context} is available in the 027 * system. 028 * 029 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 030 * @version $JDTAUS: ContextError.java 8641 2012-09-27 06:45:17Z schulte $ 031 */ 032public class ContextError extends Error 033{ 034 //--Constants--------------------------------------------------------------- 035 036 /** Serial version UID for backwards compatibility with 1.0.x classes. */ 037 private static final long serialVersionUID = 5504595041273140818L; 038 039 //---------------------------------------------------------------Constants-- 040 //--Constructors------------------------------------------------------------ 041 042 /** 043 * Creates a new instance of {@code ContextError} taking a causing 044 * {@code Throwable}. 045 * 046 * @param cause the causing throwable. 047 */ 048 public ContextError( final Throwable cause ) 049 { 050 super( ContextErrorBundle.getInstance(). 051 getContextErrorMessage( Locale.getDefault(), 052 cause != null 053 ? cause.getMessage() 054 : null ), cause ); 055 056 } 057 058 /** 059 * Creates a new instance of {@code ContextError} taking a message. 060 * 061 * @param msg the message describing the error. 062 */ 063 public ContextError( final String msg ) 064 { 065 super( ContextErrorBundle.getInstance(). 066 getContextErrorMessage( Locale.getDefault(), msg ) ); 067 068 } 069 070 //------------------------------------------------------------Constructors-- 071}