xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::domain_exception Class Reference

The exception that is thrown for errors in domain. That is, situations where the inputs are outside of the domain on which an operation is defined.. More...

#include <domain_exception.h>

Inheritance diagram for xtd::domain_exception:
xtd::system_exception

Public Types

using exception_ref = std::optional< std::reference_wrapper< const std::exception >>
 Optional reference wrapper on std::eception. More...
 

Public Member Functions

 domain_exception (const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::error_code &error, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::string &help_link, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::error_code &error, const std::string &help_link, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::exception &inner_exception, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::exception &inner_exception, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::exception &inner_exception, const std::error_code &error, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::exception &inner_exception, const std::string &help_link, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
 domain_exception (const std::string &message, const std::exception &inner_exception, const std::error_code &error, const std::string &help_link, const xtd::caller_info &info=xtd::caller_info::empty())
 Create a new instance of class domain_exception. More...
 
virtual std::error_code error () const noexcept
 Get error associate to the exception. More...
 
virtual const std::string & file_path () const noexcept
 Get file path where exception occurred. More...
 
virtual const std::string & help_link () const noexcept
 Gets a link to the help file associated with this exception. More...
 
virtual exception_ref inner_exception () const noexcept
 Gets the exception instance that caused the current exception. More...
 
virtual uint32_t line_numer () const noexcept
 Get Line number where the exception occurred. More...
 
virtual const std::string & member_name () const noexcept
 Get file member where exception occurred. More...
 
virtual const std::string & message () const noexcept
 Get message associate to the exception. More...
 
virtual const std::string & name () const noexcept
 Get full class name the exception. More...
 
virtual std::string stack_trace () const noexcept
 Gets a string representation of the immediate frames on the call stack. More...
 
virtual std::string to_string () const noexcept
 Returns a string that represents the current exception. More...
 
const char * what () const noexcept override
 Get message associate to the exception. More...
 

Static Public Member Functions

static bool enable_stack_trace ()
 Gets or sets if the generation of the stack trace is enabled. More...
 
static void enable_stack_trace (bool enable)
 

Detailed Description

The exception that is thrown for errors in domain. That is, situations where the inputs are outside of the domain on which an operation is defined..

Library
xtd.core
Examples
The following example demonstrates how to throw and catch an domain_exception.

The documentation for this class was generated from the following file: