Data Access Library (DAL)
|
00001 /* Copyright 2011-2012 ASTRON, Netherlands Institute for Radio Astronomy 00002 * This file is part of the Data Access Library (DAL). 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 3 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 #ifndef DAL_EXCEPTIONS_H 00018 #define DAL_EXCEPTIONS_H 00019 00020 #include <stdexcept> 00021 #include <string> 00022 #include "errorstack.h" 00023 00024 namespace dal { 00025 00026 class DALException: public std::runtime_error 00027 { 00028 public: 00029 DALException(const std::string &msg): std::runtime_error(msg) {} 00030 }; 00031 00032 class DALValueError: public DALException 00033 { 00034 public: 00035 DALValueError(const std::string &msg): DALException(msg) {} 00036 }; 00037 00038 class DALIndexError: public DALValueError 00039 { 00040 public: 00041 DALIndexError(const std::string &msg): DALValueError(msg) {} 00042 }; 00043 00044 class HDF5Exception: public DALException 00045 { 00046 public: 00047 HDF5Exception(const std::string &msg, const HDF5ErrorStack &stack = HDF5ErrorStack()); 00048 virtual ~HDF5Exception() throw(); 00049 00050 HDF5ErrorStack stack; 00051 00052 std::string stackSummary() const; 00053 }; 00054 00055 } 00056 00057 #endif 00058