Make CreatureException inherit from runtime_error.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
#ifndef CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
#define CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
class CreatureException : std::exception {
|
||||
std::string _error;
|
||||
|
||||
class CreatureException : public std::runtime_error {
|
||||
public:
|
||||
explicit CreatureException(std::string error) : _error(error) {}
|
||||
const char* what() const throw() override { return _error.c_str(); }
|
||||
|
||||
explicit CreatureException(const std::string& error) : std::runtime_error(error) {}
|
||||
virtual ~CreatureException() = default;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user