4 * ---------------------------------------------------------------------------
6 * Implementation of a minimal C++ class framework for use with the
7 * Microsoft Windows Application Programming Interface.
11 * This file provides the implementation for the WTK::runtime_error class,
12 * a derivative of std::exception similar to std::runtime_error, but using
13 * a "const char *" argument in preference to a std::string, to classify
16 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
17 * Copyright (C) 2012, MinGW.org Project.
19 * Based on the implementation of mingw-get's dmh_exception class
20 * Originally written by Charles Wilson <cwilso11@users.sourceforge.net>
22 * ---------------------------------------------------------------------------
24 * Permission is hereby granted, free of charge, to any person obtaining a
25 * copy of this software and associated documentation files (the "Software"),
26 * to deal in the Software without restriction, including without limitation
27 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28 * and/or sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following conditions:
31 * The above copyright notice, this permission notice, and the following
32 * disclaimer shall be included in all copies or substantial portions of
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
36 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
38 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41 * DEALINGS IN THE SOFTWARE.
43 * ---------------------------------------------------------------------------
46 #include "wtkexcept.h"
50 static const char *unspecified = "Unspecified exception";
52 runtime_error::runtime_error() throw(): message( unspecified ){}
54 runtime_error::runtime_error( const char *msg ) throw(): message( unspecified )
55 { if( msg && *msg ) message = msg; }
57 const char *runtime_error::what() const throw(){ return message; }
60 /* $RCSfile$: end of file */