Defines the base class for predefined exceptions in the xtd namespace.
Public Aliases | |
| using | exception_ref |
| Optional reference wrapper on std::exception. | |
Public Constructors | |
| exception (const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) | |
| Create a new instance of class exception. | |
| exception (const xtd::optional< xtd::string > &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) | |
| Create a new instance of class exception. | |
| template<typename exception_t> | |
| exception (const xtd::optional< xtd::string > &message, const exception_t &inner_exception, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) | |
| Create a new instance of class exception. | |
Public Properties | |
| virtual auto | help_link () const noexcept -> const xtd::string & |
| Gets a link to the help file associated with this exception. | |
| virtual auto | help_link (const xtd::string &value) noexcept -> void |
| Sets a link to the help file associated with this exception. | |
| virtual auto | h_result () const noexcept -> xtd::int32 |
| Gets HRESULT, a coded numerical value that is assigned to a specific exception. | |
| virtual auto | h_result (xtd::int32 value) noexcept -> void |
| Sets HRESULT, a coded numerical value that is assigned to a specific exception. | |
| virtual auto | error_code () const noexcept -> const std::error_code & |
| Gets error associate to the exception. | |
| virtual auto | error_code (const std::error_code &value) noexcept -> void |
| Sets error associate to the exception. | |
| virtual auto | inner_exception () const noexcept -> exception_ref |
| Gets the exception instance that caused the current exception. | |
| virtual auto | message () const noexcept -> const xtd::string & |
| Gets message associate to the exception. | |
| virtual auto | source () const noexcept -> const xtd::string & |
| Gets the name of the application or the object that causes the error. | |
| virtual auto | source (const xtd::string &value) noexcept -> void |
| Sets the name of the application or the object that causes the error. | |
| virtual auto | stack_trace () const noexcept -> xtd::string |
| Gets a string representation of the immediate frames on the call stack. | |
Public Methods | |
| virtual auto | get_last_stack_frame () const noexcept -> const xtd::diagnostics::stack_frame & |
| Gets the last stack frame where the exception occurred. | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a string that represents the current exception. | |
| auto | what () const noexcept -> const char *override |
| Gets message associate to the exception. | |
Public Static Methods | |
| static auto | enable_stack_trace () noexcept -> bool |
| Gets if the generation of the stack trace is enabled. | |
| static auto | enable_stack_trace (bool enable) noexcept -> void |
| Sets if the generation of the stack trace is enabled. @paran enable triue if stack trace enabled; otherwise false. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | equals (const object &obj) const noexcept -> bool |
| Determines whether the specified object is equal to the current object. | |
| virtual auto | get_hash_code () const noexcept -> xtd::usize |
| Serves as a hash function for a particular type. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
Optional reference wrapper on std::exception.
|
explicit |
Create a new instance of class 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(). |
|
explicit |
Create a new instance of class exception.
| 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(). |
|
inline |
Create a new instance of class exception.
| 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(). |
|
nodiscardvirtualnoexcept |
Gets a link to the help file associated with this exception.
|
virtualnoexcept |
Sets a link to the help file associated with this exception.
| value | A string represent a link to Help file associated with exception |
|
nodiscardvirtualnoexcept |
Gets HRESULT, a coded numerical value that is assigned to a specific exception.
|
virtualnoexcept |
Sets HRESULT, a coded numerical value that is assigned to a specific exception.
| value | The HRESULT value. |
|
nodiscardvirtualnoexcept |
Gets error associate to the exception.
|
virtualnoexcept |
Sets error associate to the exception.
| value | An error_code represent a Error associate to the exception |
|
nodiscardvirtualnoexcept |
Gets the exception instance that caused the current exception.
|
nodiscardvirtualnoexcept |
Gets message associate to the exception.
Reimplemented in xtd::io::file_not_found_exception.
|
nodiscardvirtualnoexcept |
Gets the name of the application or the object that causes the error.
|
virtualnoexcept |
Sets the name of the application or the object that causes the error.
|
nodiscardvirtualnoexcept |
Gets a string representation of the immediate frames on the call stack.
|
nodiscardvirtualnoexcept |
Gets the last stack frame where the exception occurred.
|
nodiscardoverridevirtualnoexcept |
Returns a string that represents the current exception.
Reimplemented from xtd::object.
|
nodiscardoverridenoexcept |
Gets message associate to the exception.
|
staticnodiscardnoexcept |
Gets if the generation of the stack trace is enabled.
|
staticnoexcept |
Sets if the generation of the stack trace is enabled. @paran enable triue if stack trace enabled; otherwise false.