xtd 0.2.0
Loading...
Searching...
No Matches
system_exception.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "exception.hpp"
6
8namespace xtd {
18 class system_exception : public exception {
19 public:
21
35 template<class exception_t>
38
40 system_exception(const system_exception&) = default;
41 system_exception& operator =(const system_exception&) = default;
43
45
50 [[deprecated("Replaced by xtd::exception::get_last_stack_frame().get_file_name - Will be removed in version 0.4.0.")]]
51 virtual const xtd::string& file_path() const noexcept;
52
56 [[deprecated("Replaced by xtd::exception::get_last_stack_frame().get_file_line_number - Will be removed in version 0.4.0.")]]
57 virtual xtd::size line_number() const noexcept;
58
62 [[deprecated("Replaced by xtd::exception::get_last_stack_frame().get_method - Will be removed in version 0.4.0.")]]
63 virtual const xtd::string& member_name() const noexcept;
64
68 [[deprecated("Replaced by xtd::exception::get_type().full_name() - Will be removed in version 0.4.0.")]]
69 virtual const xtd::string& name() const noexcept;
71
73
80 //[[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.")]]
81 explicit system_exception(const xtd::string& message, const std::error_code& error, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
87 //[[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.")]]
88 explicit system_exception(const xtd::string& message, const xtd::string& help_link, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
95 //[[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.")]]
96 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());
102 //[[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.")]]
103 explicit system_exception(const std::exception& inner_exception, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
109 //[[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.")]]
110 explicit system_exception(const xtd::string& message, const std::exception& inner_exception, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
117 //[[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.")]]
118 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());
125 //[[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.")]]
126 explicit 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());
134 //[[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.")]]
135 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());
137 };
138}
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:48
static stack_frame current(const xtd::diagnostics::source_location &value=xtd::diagnostics::source_location::current()) noexcept
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
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.
exception(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Create a new instance of class exception.
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.hpp:238
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.hpp: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.hpp:36
virtual const xtd::string & file_path() const noexcept
Gets file path where exception occurred.
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.
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.
Contains xtd::exception exception.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:25
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8