Defines the base class for predefined exceptions in the xtd namespace.
- Namespace
- xtd
- Library
- xtd.core
- Examples
- user_defined_exception.cpp.
|
virtual const xtd::string & | help_link () const noexcept |
| Gets a link to the help file associated with this exception.
|
|
virtual void | help_link (const xtd::string &value) noexcept |
| Sets a link to the help file associated with this exception.
|
|
virtual int32 | h_result () const noexcept |
| Gets HRESULT, a coded numerical value that is assigned to a specific exception.
|
|
virtual void | h_result (int32 value) noexcept |
| Sets HRESULT, a coded numerical value that is assigned to a specific exception.
|
|
virtual const std::error_code & | error_code () const noexcept |
| Gets error associate to the exception.
|
|
virtual void | error_code (const std::error_code &value) noexcept |
| Sets error associate to the exception.
|
|
virtual exception_ref | inner_exception () const noexcept |
| Gets the exception instance that caused the current exception.
|
|
virtual const xtd::string & | message () const noexcept |
| Gets message associate to the exception.
|
|
virtual const xtd::string & | source () const noexcept |
| Gets the name of the application or the object that causes the error.
|
|
virtual void | source (const xtd::string &value) noexcept |
| Sets the name of the application or the object that causes the error.
|
|
virtual xtd::string | stack_trace () const noexcept |
| Gets a string representation of the immediate frames on the call stack.
|
|
|
static bool | enable_stack_trace () noexcept |
| Gets if the generation of the stack trace is enabled.
|
|
static void | enable_stack_trace (bool enable) noexcept |
| Sets if the generation of the stack trace is enabled. @paran enable triue if stack trace enabled; otherwhise false.
|
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
virtual type_object | get_type () const noexcept |
| Gets the type of the current instance.
|
|
template<typename object_t > |
xtd::uptr< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|
◆ exception_ref
Optional reference wrapper on std::exception.
◆ exception() [1/3]
Create a new instance of class exception.
- Parameters
-
◆ exception() [2/3]
Create a new instance of class exception.
- Parameters
-
message | Message string associate to the exception. |
stack_frame | (optional) Contains current stack frame about member name, file path and line number in the file where the exception is occurred. Typically xtd::diagnostics::stack_frame::current(). |
◆ exception() [3/3]
template<typename exception_t >
Create a new instance of class exception.
- Parameters
-
message | Message string associate to the exception. |
inner_exception | The exception that is the cause of the current exception. |
stack_frame | (optional) Contains current stack frame about member name, file path and line number in the file where the exception is occurred. Typically xtd::diagnostics::stack_frame::current(). |
◆ help_link() [1/2]
virtual const xtd::string & xtd::exception::help_link |
( |
| ) |
const |
|
virtualnoexcept |
Gets a link to the help file associated with this exception.
- Returns
- A string represent a link to Help file associated with exception
◆ help_link() [2/2]
virtual void xtd::exception::help_link |
( |
const xtd::string & |
value | ) |
|
|
virtualnoexcept |
Sets a link to the help file associated with this exception.
- Parameters
-
value | A string represent a link to Help file associated with exception |
◆ h_result() [1/2]
virtual int32 xtd::exception::h_result |
( |
| ) |
const |
|
virtualnoexcept |
Gets HRESULT, a coded numerical value that is assigned to a specific exception.
- Returns
- The HRESULT value.
◆ h_result() [2/2]
virtual void xtd::exception::h_result |
( |
int32 |
value | ) |
|
|
virtualnoexcept |
Sets HRESULT, a coded numerical value that is assigned to a specific exception.
- Parameters
-
◆ error_code() [1/2]
virtual const std::error_code & xtd::exception::error_code |
( |
| ) |
const |
|
virtualnoexcept |
Gets error associate to the exception.
- Returns
- An error_code represent a Error associate to the exception
◆ error_code() [2/2]
virtual void xtd::exception::error_code |
( |
const std::error_code & |
value | ) |
|
|
virtualnoexcept |
Sets error associate to the exception.
- Parameters
-
value | An error_code represent a Error associate to the exception |
◆ inner_exception()
Gets the exception instance that caused the current exception.
- Returns
- An instance of exception that describes the error that caused the current exception. The inner_exception property returns the same value as was passed into the constructor, or a null reference if the inner exception value was not supplied to the constructor.
◆ message()
virtual const xtd::string & xtd::exception::message |
( |
| ) |
const |
|
virtualnoexcept |
◆ source() [1/2]
virtual const xtd::string & xtd::exception::source |
( |
| ) |
const |
|
virtualnoexcept |
Gets the name of the application or the object that causes the error.
- Returns
- The name of the application or the object that causes the error.
◆ source() [2/2]
virtual void xtd::exception::source |
( |
const xtd::string & |
value | ) |
|
|
virtualnoexcept |
Sets the name of the application or the object that causes the error.
- Returns
- The name of the application or the object that causes the error.
◆ stack_trace()
virtual xtd::string xtd::exception::stack_trace |
( |
| ) |
const |
|
virtualnoexcept |
Gets a string representation of the immediate frames on the call stack.
- Returns
- A string that describes the immediate frames of the call stack.
- Examples
- file_info_move_to.cpp.
◆ get_last_stack_frame()
Gets the last stack frame where the exception occurred.
- Returns
- The last stack frame where exception occurred
◆ to_string()
Returns a string that represents the current exception.
- Returns
- A string that represents the current exception.
Reimplemented from xtd::object.
◆ what()
const char * xtd::exception::what |
( |
| ) |
const |
|
overridenoexcept |
Gets message associate to the exception.
- Returns
- A string represent a massage associate to the exception
◆ enable_stack_trace() [1/2]
static bool xtd::exception::enable_stack_trace |
( |
| ) |
|
|
staticnoexcept |
Gets if the generation of the stack trace is enabled.
- Returns
- triue if stack trace enabled; otherwhise false.
◆ enable_stack_trace() [2/2]
static void xtd::exception::enable_stack_trace |
( |
bool |
enable | ) |
|
|
staticnoexcept |
Sets if the generation of the stack trace is enabled. @paran enable triue if stack trace enabled; otherwhise false.
The documentation for this class was generated from the following file: