SDLU/SDLU/exceptions/ObjectCreationException.hpp

31 lines
628 B
C++
Raw Normal View History

/**
* @file ObjectCreationException.hpp
* @brief An exception object to handle failed object creations
* @author Lauchmelder23
* @date 16.05.2020
*/
#pragma once
#include <exception>
2020-05-18 20:20:00 +02:00
#include <string>
namespace sdlu
{
class ObjectCreationException :
virtual public std::exception
{
public:
2020-05-18 20:20:00 +02:00
ObjectCreationException(std::string description) :
m_pDescription(description)
{
// Empty
}
virtual const char* what() const throw()
{
2020-05-18 20:20:00 +02:00
return m_pDescription.c_str();
}
private:
2020-05-18 20:20:00 +02:00
std::string m_pDescription;
};
}