1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-04-27 18:56:49 +03:00
wsrep-lib/include/wsrep/exception.hpp
Teemu Ollakka 1f6a6db1e9 * Fixes to SST time server state management
* Logging tweaks
* Boolean to tune behavior on exception
2018-06-22 13:03:12 +03:00

45 lines
770 B
C++

//
// Copyright (C) 2018 Codership Oy <info@codership.com>
//
#ifndef WSREP_EXCEPTION_HPP
#define WSREP_EXCEPTION_HPP
#include <stdexcept>
#include <cstdlib>
namespace wsrep
{
extern bool abort_on_exception;
class runtime_error : public std::runtime_error
{
public:
runtime_error(const std::string& msg)
: std::runtime_error(msg)
{
if (abort_on_exception)
{
::abort();
}
}
};
class not_implemented_error : public std::exception
{
public:
not_implemented_error()
: std::exception()
{
::abort();
}
};
class fatal_error : public std::exception
{
};
}
#endif // WSREP_EXCEPTION_HPP