EsysException.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __ESCRIPT_ESYSEXCEPTION_H__
#define __ESCRIPT_ESYSEXCEPTION_H__
#include <exception>
#include <string>
namespace escript {
class EsysException : public std::exception
{
public:
EsysException(const std::string& message) : msg(message) {}
virtual ~EsysException() throw() {}
inline virtual const char* what() const throw() { return msg.c_str(); }
private:
//
// the exception message
std::string msg;
};
class AssertException : public EsysException
{
public:
AssertException(const std::string& str) : EsysException(str) {}
};
class IOError : public EsysException
{
public:
IOError(const std::string& str) : EsysException(str) {}
};
class NotImplementedError : public EsysException
{
public:
NotImplementedError(const std::string& str) : EsysException(str) {}
};
class ValueError : public EsysException
{
public:
ValueError(const std::string& str) : EsysException(str) {}
};
} // namespace escript
#endif // __ESCRIPT_ESYSEXCEPTION_H__
escript::EsysException::msg
std::string msg
Definition: EsysException.h:80
message
Definition: blocktools.h:69
escript::EsysException
The base class for escript exceptions.
Definition: EsysException.h:43
escript::NotImplementedError
An exception class for features which are not (yet) implemented.
Definition: EsysException.h:93
escript::EsysException::~EsysException
virtual ~EsysException()
Destructor.
Definition: EsysException.h:69
escript::ValueError::ValueError
ValueError(const std::string &str)
Definition: EsysException.h:106
escript::IOError
An exception class for Input/Output errors.
Definition: EsysException.h:83
escript::NotImplementedError::NotImplementedError
NotImplementedError(const std::string &str)
Definition: EsysException.h:96
escript::EsysException::EsysException
EsysException(const std::string &message)
Constructor which creates an Exception with the given message.
Definition: EsysException.h:66
escript::IOError::IOError
IOError(const std::string &str)
Definition: EsysException.h:86
escript::AssertException::AssertException
AssertException(const std::string &str)
Definition: EsysException.h:76
escript
Definition: AbstractContinuousDomain.cpp:23
escript::EsysException::what
virtual const char * what() const
Returns a description of the exception.
Definition: EsysException.h:75
escript::ValueError
An exception class that signals an invalid argument value.
Definition: EsysException.h:103