blob: 55c360ded31a9511453bcd85cd829c5defc1bbd3 [file] [log] [blame]
#pragma once
#include <exception>
#include <string>
namespace fuzzing {
namespace exception {
class ExceptionBase : public std::exception {
public:
ExceptionBase(void) = default;
/* typeid(T).name */
};
/* Recoverable exception */
class FlowException : public ExceptionBase {
public:
FlowException(void) : ExceptionBase() { }
};
/* Error in this library, should never happen */
class LogicException : public ExceptionBase {
private:
std::string reason;
public:
LogicException(const std::string r) : ExceptionBase(), reason(r) { }
virtual const char* what(void) const throw() {
return reason.c_str();
}
};
/* Error in target application */
class TargetException : public ExceptionBase {
private:
std::string reason;
public:
TargetException(const std::string r) : ExceptionBase(), reason(r) { }
virtual const char* what(void) const throw() {
return reason.c_str();
}
};
} /* namespace exception */
} /* namespace fuzzing */