2016-11-11 22:22:44 +00:00
|
|
|
// tasmet_exception.h
|
|
|
|
//
|
|
|
|
// Author: J.A. de Jong
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#ifndef TASMET_EXCEPTION_H
|
|
|
|
#define TASMET_EXCEPTION_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <stdexcept>
|
2016-12-08 21:02:21 +00:00
|
|
|
#include <sstream> // stringstream
|
2016-11-11 22:22:44 +00:00
|
|
|
|
|
|
|
class TaSMETError : public std::runtime_error {
|
|
|
|
public:
|
|
|
|
TaSMETError(const std::string& msg = "") : std::runtime_error(msg) {}
|
2016-12-08 21:02:21 +00:00
|
|
|
TaSMETError(const std::stringstream& stream) : std::runtime_error(stream.str()){}
|
2016-11-11 22:22:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class TasMETBadAlloc: public std::bad_alloc {
|
|
|
|
virtual const char* what() const throw();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TASMET_EXCEPTION_H
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|