00001 /*************************************************************************** 00002 * * 00003 * LinuxSampler - modular, streaming capable sampler * 00004 * * 00005 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * 00006 * Copyright (C) 2005, 2006 Christian Schoenebeck * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00021 * MA 02111-1307 USA * 00022 ***************************************************************************/ 00023 00024 #ifndef __LS_EXCEPTION_H 00025 #define __LS_EXCEPTION_H 00026 00027 #include <stdexcept> 00028 #include <iostream> 00029 #include "global.h" 00030 00031 namespace LinuxSampler { 00032 00037 class Exception : public std::runtime_error { 00038 public: 00044 Exception(const String& msg) : runtime_error(msg) { 00045 } 00046 00050 String Message() { 00051 return what(); 00052 } 00053 00058 void PrintMessage() { 00059 std::cerr << what() << std::endl << std::flush; 00060 } 00061 }; 00062 00063 } // namespace LinuxSampler 00064 00065 #endif // __LS_EXCEPTION_H