NeXus  1
NeXusException.cpp
Go to the documentation of this file.
1 #include "NeXusFile.hpp"
2 #include "NeXusException.hpp"
3 
9 namespace NeXus
10 {
11 
12 Exception::Exception(const std::string& msg, const int status) :
13  std::runtime_error(msg) {
14  this->m_what = msg;
15  this->m_status = status;
16 }
17 
18 const char* Exception::what() const throw() {
19  return this->m_what.c_str();
20 }
21 
22 int Exception::status() throw() {
23  return this->m_status;
24 }
25 
27 }
28 
29 }
Definition of the NeXus C++ API.
virtual ~Exception()
Destructor for exception.
STL namespace.
Header for a base NeXus::Exception.
Exception(const std::string &msg="GENERIC ERROR", const int status=0)
Create a new NeXus::Exception.
int status()
Get the status associated with the exception.
virtual const char * what() const
Get the message associated with the exception.