BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Used to generate a useful error report when an exception is thrown. More...
#include <exception.hpp>
Public Types | |
enum | code_enum { code_value = unspecified_exception_code } |
Public Member Functions | |
exception (int64_t code=unspecified_exception_code, const std::string &name_value="exception", const std::string &what_value="unspecified") | |
exception (log_message &&, int64_t code=unspecified_exception_code, const std::string &name_value="exception", const std::string &what_value="unspecified") | |
exception (log_messages &&, int64_t code=unspecified_exception_code, const std::string &name_value="exception", const std::string &what_value="unspecified") | |
exception (const log_messages &, int64_t code=unspecified_exception_code, const std::string &name_value="exception", const std::string &what_value="unspecified") | |
exception (const exception &e) | |
exception (exception &&e) | |
virtual | ~exception () |
const char * | name () const throw () |
int64_t | code () const throw () |
virtual const char * | what () const throw () |
const log_messages & | get_log () const |
void | append_log (log_message m) |
std::string | to_detail_string (log_level ll=log_level::all) const |
std::string | to_string (log_level ll=log_level::info) const |
virtual void | dynamic_rethrow_exception () const |
virtual std::shared_ptr< exception > | dynamic_copy_exception () const |
exception & | operator= (const exception ©) |
exception & | operator= (exception &©) |
Protected Attributes | |
std::unique_ptr< detail::exception_impl > | my |
Friends | |
void | to_variant (const exception &e, variant &v, uint32_t max_depth) |
void | from_variant (const variant &e, exception &ll, uint32_t max_depth) |
Used to generate a useful error report when an exception is thrown.
At each level in the stack where the exception is caught and rethrown a new log_message is added to the exception.
exception's are designed to be serialized to a variant and deserialized from an variant.
Definition at line 56 of file exception.hpp.
Enumerator | |
---|---|
code_value |
Definition at line 59 of file exception.hpp.
fc::exception::exception | ( | int64_t | code = unspecified_exception_code , |
const std::string & | name_value = "exception" , |
||
const std::string & | what_value = "unspecified" |
||
) |
Definition at line 112 of file exception.cpp.
fc::exception::exception | ( | log_message && | msg, |
int64_t | code = unspecified_exception_code , |
||
const std::string & | name_value = "exception" , |
||
const std::string & | what_value = "unspecified" |
||
) |
Definition at line 122 of file exception.cpp.
fc::exception::exception | ( | log_messages && | msgs, |
int64_t | code = unspecified_exception_code , |
||
const std::string & | name_value = "exception" , |
||
const std::string & | what_value = "unspecified" |
||
) |
Definition at line 60 of file exception.cpp.
fc::exception::exception | ( | const log_messages & | msgs, |
int64_t | code = unspecified_exception_code , |
||
const std::string & | name_value = "exception" , |
||
const std::string & | what_value = "unspecified" |
||
) |
Definition at line 71 of file exception.cpp.
fc::exception::exception | ( | const exception & | e | ) |
Definition at line 133 of file exception.cpp.
fc::exception::exception | ( | exception && | e | ) |
Definition at line 136 of file exception.cpp.
|
virtual |
Definition at line 143 of file exception.cpp.
void fc::exception::append_log | ( | log_message | m | ) |
Definition at line 173 of file exception.cpp.
int64_t fc::exception::code | ( | ) | const | |
throw | ( | |||
) |
Definition at line 141 of file exception.cpp.
|
virtual |
This is equivalent to:
Reimplemented in fc::unhandled_exception.
Definition at line 267 of file exception.cpp.
|
virtual |
Throw this exception as its most derived type.
Rethrows the exception restoring the proper type based upon the error code. This is used to propagate exception types across conversions to/from JSON
Reimplemented in fc::unhandled_exception.
Definition at line 262 of file exception.cpp.
const log_messages & fc::exception::get_log | ( | ) | const |
Definition at line 172 of file exception.cpp.
const char * fc::exception::name | ( | ) | const | |
throw | ( | |||
) |
Definition at line 139 of file exception.cpp.
Definition at line 296 of file exception.cpp.
Definition at line 302 of file exception.cpp.
string fc::exception::to_detail_string | ( | log_level | ll = log_level::all | ) | const |
Generates a detailed string including file, line, method, and other information that is generally only useful for developers.
Definition at line 183 of file exception.cpp.
string fc::exception::to_string | ( | log_level | ll = log_level::info | ) | const |
Generates a user-friendly error report.
Definition at line 227 of file exception.cpp.
|
virtual |
Definition at line 140 of file exception.cpp.
Definition at line 158 of file exception.cpp.
Definition at line 145 of file exception.cpp.
|
protected |
Definition at line 126 of file exception.hpp.