BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Defines exception's used by fc. More...
#include <fc/log/logger.hpp>
#include <fc/optional.hpp>
#include <exception>
#include <functional>
#include <unordered_map>
Go to the source code of this file.
Classes | |
class | fc::exception |
Used to generate a useful error report when an exception is thrown. More... | |
class | fc::unhandled_exception |
re-thrown whenever an unhandled exception is caught. More... | |
class | fc::exception_factory |
struct | fc::exception_factory::base_exception_builder |
struct | fc::exception_factory::exception_builder< T > |
Namespaces | |
fc | |
fc::detail | |
Macros | |
#define | FC_REGISTER_EXCEPTION(r, unused, base) fc::exception_factory::instance().register_exception<base>(); |
#define | FC_REGISTER_EXCEPTIONS(SEQ) |
#define | FC_DECLARE_DERIVED_EXCEPTION(TYPE, BASE, CODE) |
#define | FC_IMPLEMENT_DERIVED_EXCEPTION(TYPE, BASE, CODE, WHAT) |
#define | FC_DECLARE_EXCEPTION(TYPE, CODE) FC_DECLARE_DERIVED_EXCEPTION( TYPE, fc::exception, CODE ) |
#define | FC_IMPLEMENT_EXCEPTION(TYPE, CODE, WHAT) FC_IMPLEMENT_DERIVED_EXCEPTION( TYPE, fc::exception, CODE, WHAT ) |
#define | LIKELY(x) (x) |
#define | UNLIKELY(x) (x) |
#define | FC_EXPAND_MACRO(x) x |
: Workaround for varying preprocessing behavior between MSVC and gcc More... | |
#define | FC_ASSERT(TEST, ...) |
Checks a condition and throws an assert_exception if the test is FALSE. More... | |
#define | FC_CAPTURE_AND_THROW(EXCEPTION_TYPE, ...) |
#define | FC_INDIRECT_EXPAND(MACRO, ARGS) MACRO ARGS |
#define | FC_THROW( ...) |
#define | FC_EXCEPTION(EXCEPTION_TYPE, FORMAT, ...) EXCEPTION_TYPE( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ) |
#define | FC_THROW_EXCEPTION(EXCEPTION, FORMAT, ...) |
#define | FC_RETHROW_EXCEPTION(ER, LOG_LEVEL, FORMAT, ...) |
Appends a log_message to the exception ER and rethrows it. More... | |
#define | FC_LOG_AND_RETHROW() |
#define | FC_CAPTURE_LOG_AND_RETHROW(...) |
#define | FC_CAPTURE_AND_LOG(...) |
#define | FC_RETHROW_EXCEPTIONS(LOG_LEVEL, FORMAT, ...) |
Catchs all exception's, std::exceptions, and ... and rethrows them after appending the provided log message. More... | |
#define | FC_CAPTURE_AND_RETHROW(...) |
Typedefs | |
typedef std::shared_ptr< exception > | fc::exception_ptr |
typedef optional< exception > | fc::oexception |
Enumerations | |
enum | fc::exception_code { fc::unspecified_exception_code = 0, fc::unhandled_exception_code = 1, fc::timeout_exception_code = 2, fc::file_not_found_exception_code = 3, fc::parse_error_exception_code = 4, fc::invalid_arg_exception_code = 5, fc::key_not_found_exception_code = 6, fc::bad_cast_exception_code = 7, fc::out_of_range_exception_code = 8, fc::canceled_exception_code = 9, fc::assert_exception_code = 10, fc::eof_exception_code = 11, fc::std_exception_code = 13, fc::invalid_operation_exception_code = 14, fc::unknown_host_exception_code = 15, fc::null_optional_code = 16, fc::aes_error_code = 18, fc::overflow_code = 19, fc::underflow_code = 20, fc::divide_by_zero_code = 21, fc::method_not_found_exception_code = 22 } |
Functions | |
void | fc::to_variant (const exception &e, variant &v, uint32_t max_depth) |
void | fc::from_variant (const variant &e, exception &ll, uint32_t max_depth) |
template<typename T > | |
fc::exception_ptr | fc::copy_exception (T &&e) |
fc::FC_DECLARE_EXCEPTION (timeout_exception, timeout_exception_code) | |
fc::FC_DECLARE_EXCEPTION (file_not_found_exception, file_not_found_exception_code) | |
fc::FC_DECLARE_EXCEPTION (parse_error_exception, parse_error_exception_code) | |
reports parse errors More... | |
fc::FC_DECLARE_EXCEPTION (invalid_arg_exception, invalid_arg_exception_code) | |
fc::FC_DECLARE_EXCEPTION (key_not_found_exception, key_not_found_exception_code) | |
reports when a key, guid, or other item is not found. More... | |
fc::FC_DECLARE_EXCEPTION (bad_cast_exception, bad_cast_exception_code) | |
fc::FC_DECLARE_EXCEPTION (out_of_range_exception, out_of_range_exception_code) | |
fc::FC_DECLARE_EXCEPTION (method_not_found_exception, method_not_found_exception_code) | |
fc::FC_DECLARE_EXCEPTION (invalid_operation_exception, invalid_operation_exception_code) | |
if an operation is unsupported or not valid this may be thrown More... | |
fc::FC_DECLARE_EXCEPTION (unknown_host_exception, unknown_host_exception_code) | |
if an host name can not be resolved this may be thrown More... | |
fc::FC_DECLARE_EXCEPTION (canceled_exception, canceled_exception_code) | |
used to report a canceled Operation More... | |
fc::FC_DECLARE_EXCEPTION (assert_exception, assert_exception_code) | |
used inplace of assert() to report violations of pre conditions. More... | |
fc::FC_DECLARE_EXCEPTION (eof_exception, eof_exception_code) | |
fc::FC_DECLARE_EXCEPTION (null_optional, null_optional_code) | |
fc::FC_DECLARE_EXCEPTION (aes_exception, aes_error_code) | |
fc::FC_DECLARE_EXCEPTION (overflow_exception, overflow_code) | |
fc::FC_DECLARE_EXCEPTION (underflow_exception, underflow_code) | |
fc::FC_DECLARE_EXCEPTION (divide_by_zero_exception, divide_by_zero_code) | |
std::string | fc::except_str () |
void | fc::record_assert_trip (const char *filename, uint32_t lineno, const char *expr) |
Variables | |
bool | fc::enable_record_assert_trip = false |
Defines exception's used by fc.
Definition in file exception.hpp.
#define FC_ASSERT | ( | TEST, | |
... | |||
) |
Checks a condition and throws an assert_exception if the test is FALSE.
Definition at line 345 of file exception.hpp.
#define FC_CAPTURE_AND_LOG | ( | ... | ) |
Definition at line 438 of file exception.hpp.
#define FC_CAPTURE_AND_RETHROW | ( | ... | ) |
Definition at line 479 of file exception.hpp.
#define FC_CAPTURE_AND_THROW | ( | EXCEPTION_TYPE, | |
... | |||
) |
Definition at line 357 of file exception.hpp.
#define FC_CAPTURE_LOG_AND_RETHROW | ( | ... | ) |
Definition at line 415 of file exception.hpp.
#define FC_DECLARE_DERIVED_EXCEPTION | ( | TYPE, | |
BASE, | |||
CODE | |||
) |
Definition at line 226 of file exception.hpp.
#define FC_DECLARE_EXCEPTION | ( | TYPE, | |
CODE | |||
) | FC_DECLARE_DERIVED_EXCEPTION( TYPE, fc::exception, CODE ) |
Definition at line 278 of file exception.hpp.
#define FC_EXCEPTION | ( | EXCEPTION_TYPE, | |
FORMAT, | |||
... | |||
) | EXCEPTION_TYPE( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ) |
Definition at line 371 of file exception.hpp.
#define FC_EXPAND_MACRO | ( | x | ) | x |
: Workaround for varying preprocessing behavior between MSVC and gcc
Definition at line 341 of file exception.hpp.
#define FC_IMPLEMENT_DERIVED_EXCEPTION | ( | TYPE, | |
BASE, | |||
CODE, | |||
WHAT | |||
) |
Definition at line 249 of file exception.hpp.
#define FC_IMPLEMENT_EXCEPTION | ( | TYPE, | |
CODE, | |||
WHAT | |||
) | FC_IMPLEMENT_DERIVED_EXCEPTION( TYPE, fc::exception, CODE, WHAT ) |
Definition at line 281 of file exception.hpp.
#define FC_INDIRECT_EXPAND | ( | MACRO, | |
ARGS | |||
) | MACRO ARGS |
Definition at line 365 of file exception.hpp.
#define FC_LOG_AND_RETHROW | ( | ) |
Definition at line 395 of file exception.hpp.
#define FC_REGISTER_EXCEPTION | ( | r, | |
unused, | |||
base | |||
) | fc::exception_factory::instance().register_exception<base>(); |
Definition at line 215 of file exception.hpp.
#define FC_REGISTER_EXCEPTIONS | ( | SEQ | ) |
Definition at line 218 of file exception.hpp.
#define FC_RETHROW_EXCEPTION | ( | ER, | |
LOG_LEVEL, | |||
FORMAT, | |||
... | |||
) |
Appends a log_message to the exception ER and rethrows it.
Definition at line 389 of file exception.hpp.
#define FC_RETHROW_EXCEPTIONS | ( | LOG_LEVEL, | |
FORMAT, | |||
... | |||
) |
Catchs all exception's, std::exceptions, and ... and rethrows them after appending the provided log message.
Definition at line 464 of file exception.hpp.
#define FC_THROW | ( | ... | ) |
Definition at line 366 of file exception.hpp.
#define FC_THROW_EXCEPTION | ( | EXCEPTION, | |
FORMAT, | |||
... | |||
) |
EXCEPTION | a class in the Phoenix::Athena::API namespace that inherits |
FORMAT | a const char* string with "${keys}" |
... | other parameters |
Definition at line 379 of file exception.hpp.
#define LIKELY | ( | x | ) | (x) |
Definition at line 334 of file exception.hpp.
#define UNLIKELY | ( | x | ) | (x) |
Definition at line 335 of file exception.hpp.