2012-09-08 02:50:37 +00:00
|
|
|
#ifndef _FC_ERROR_HPP_
|
|
|
|
|
#define _FC_ERROR_HPP_
|
2012-09-09 03:46:19 +00:00
|
|
|
#include <fc/string.hpp>
|
2012-09-08 02:50:37 +00:00
|
|
|
|
|
|
|
|
namespace fc {
|
|
|
|
|
struct future_wait_timeout: public std::exception{};
|
|
|
|
|
struct task_canceled: public std::exception{};
|
|
|
|
|
struct thread_quit: public std::exception{};
|
|
|
|
|
struct wait_any_error: public std::exception{};
|
2012-09-09 03:46:19 +00:00
|
|
|
|
|
|
|
|
struct pke_exception : public std::exception {};
|
|
|
|
|
struct invalid_buffer_length : public pke_exception {};
|
|
|
|
|
struct invalid_key_length : public pke_exception {};
|
|
|
|
|
|
|
|
|
|
struct generic_exception : public std::exception {
|
|
|
|
|
generic_exception( const fc::string& msg = "" ):m_msg(msg){}
|
|
|
|
|
~generic_exception()throw() {}
|
|
|
|
|
const char* what()const throw() { return m_msg.c_str(); }
|
|
|
|
|
private:
|
|
|
|
|
fc::string m_msg;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2012-09-08 02:50:37 +00:00
|
|
|
struct bad_cast: public std::exception{
|
|
|
|
|
const char* what()const throw(){ return "bad cast"; }
|
|
|
|
|
};
|
|
|
|
|
struct range_error: public std::exception{
|
|
|
|
|
const char* what()const throw(){ return "range error"; }
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // _FC_ERROR_HPP_
|