xtd 0.2.0
Loading...
Searching...
No Matches
system_exception.h
Go to the documentation of this file.
1
4#pragma once
5#include "exception.h"
6
8namespace xtd {
18 class system_exception : public exception {
19 public:
21
35 template<typename exception_t>
37
43 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame) and manually set the property xtd::exception::error_code - Will be removed in version 0.4.0.")]]
44 explicit system_exception(const xtd::string& message, const std::error_code& error, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
50 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame) and manually set the property xtd::exception::help_link - Will be removed in version 0.4.0.")]]
58 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame) and manually set the properties xtd::exception::error_code and xtd::exception::help_link - Will be removed in version 0.4.0.")]]
59 explicit system_exception(const xtd::string& message, const std::error_code& error, const xtd::string& help_link, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
65 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const exception_t& inner_exception, const xtd::diagnostics::stack_frame& stack_frame) - Will be removed in version 0.4.0.")]]
72 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const exception_t& inner_exception, const xtd::diagnostics::stack_frame& stack_frame) - Will be removed in version 0.4.0.")]]
80 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const exception_t& inner_exception, const xtd::diagnostics::stack_frame& stack_frame) and manually set the property xtd::exception::error_code - Will be removed in version 0.4.0.")]]
81 explicit system_exception(const xtd::string& message, const std::exception& inner_exception, const std::error_code& error, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
88 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const exception_t& inner_exception, const xtd::diagnostics::stack_frame& stack_frame) and manually set the property xtd::exception::help_link - Will be removed in version 0.4.0.")]]
97 //[[deprecated("Use xtd::system_exception (const xtd::string& message, const exception_t& inner_exception, const xtd::diagnostics::stack_frame& stack_frame) and manually set the properties xtd::exception::error_code and xtd::exception::help_link - Will be removed in version 0.4.0.")]]
98 explicit system_exception(const xtd::string& message, const std::exception& inner_exception, const std::error_code& error, const xtd::string& help_link, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
100
102 system_exception(const system_exception&) = default;
103 system_exception& operator =(const system_exception&) = default;
105
107
112 [[deprecated("Replaced by xtd::exception::get_last_stack_frame().get_file_name - Will be removed in version 0.4.0.")]]
113 virtual const xtd::string& file_path() const noexcept;
114
118 [[deprecated("Replaced by xtd::exception::get_last_stack_frame().get_file_line_number - Will be removed in version 0.4.0.")]]
119 virtual xtd::size line_number() const noexcept;
120
124 [[deprecated("Replaced by xtd::exception::get_last_stack_frame().get_method - Will be removed in version 0.4.0.")]]
125 virtual const xtd::string& member_name() const noexcept;
126
130 [[deprecated("Replaced by xtd::exception::get_type().full_name() - Will be removed in version 0.4.0.")]]
131 virtual const xtd::string& name() const noexcept;
133 };
134}
Represents text as a sequence of character units.
Definition basic_string.h:79
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
static stack_frame current(const xtd::source_location &value=xtd::source_location::current()) noexcept
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
Defines the base class for predefined exceptions in the xtd namespace.
Definition exception.h:28
virtual const std::error_code & error_code() const noexcept
Gets error associate to the exception.
virtual const xtd::string & message() const noexcept
Gets message associate to the exception.
virtual const xtd::diagnostics::stack_frame & get_last_stack_frame() const noexcept
Gets the last stack frame where the exception occurred.
virtual exception_ref inner_exception() const noexcept
Gets the exception instance that caused the current exception.
virtual const xtd::string & help_link() const noexcept
Gets a link to the help file associated with this exception.
static std::error_code make_error_code(int h_result) noexcept
Creates error code value for the specified HRESULT.
static constexpr int32 COR_E_SYSTEM
System error.
Definition h_result.h:238
virtual type_object get_type() const noexcept
Gets the type of the current instance.
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.h:18
system_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 xtd::system_exception.
Definition system_exception.h:36
system_exception(const xtd::string &message, const std::exception &inner_exception, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
system_exception(const xtd::string &message, const std::error_code &error, const xtd::string &help_link, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
system_exception(const xtd::string &message, const std::error_code &error, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
virtual const xtd::string & file_path() const noexcept
Gets file path where exception occurred.
system_exception(const xtd::string &message, const std::exception &inner_exception, const std::error_code &error, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
system_exception(const std::exception &inner_exception, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
system_exception(const xtd::string &message, const std::exception &inner_exception, const std::error_code &error, const xtd::string &help_link, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
system_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 xtd::system_exception.
virtual xtd::size line_number() const noexcept
Gets Line number where the exception occurred.
system_exception(const xtd::string &message, const xtd::string &help_link, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
virtual const xtd::string & name() const noexcept
Gets full class name the exception.
virtual const xtd::string & member_name() const noexcept
Gets file member where exception occurred.
system_exception(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
system_exception(const xtd::string &message, const std::exception &inner_exception, const xtd::string &help_link, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class xtd::system_exception.
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:114
Contains xtd::exception exception.
std::optional< type_t > optional
Represents the null_opt alias on std::nullopt_t.
Definition optional.h:181
size_t size
Represents a size of any object in bytes.
Definition size.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10