Base of every exception the library throws.
More...
|
| auto | get_exit_code () const -> int |
| | Returns the process exit code associated with this error.
|
| auto | get_name () const -> std::string |
| | Returns the short name of this error type.
|
| | error_t (std::string name, std::string msg, int exit_code=static_cast< int >(exit_codes_t::base_class)) |
| | Constructs an error with an explicit numeric exit code.
|
| | error_t (std::string name, std::string msg, exit_codes_t exit_code) |
| | Constructs an error with an exit code drawn from exit_codes_t.
|
Base of every exception the library throws.
◆ error_t() [1/2]
Constructs an error with an explicit numeric exit code.
- Parameters
-
| name | Short name of the error type. |
| msg | Human-readable description. |
| exit_code | Process exit code to report. |
◆ error_t() [2/2]
| cli::error_t::error_t |
( |
std::string | name, |
|
|
std::string | msg, |
|
|
exit_codes_t | exit_code ) |
|
inline |
Constructs an error with an exit code drawn from exit_codes_t.
- Parameters
-
| name | Short name of the error type. |
| msg | Human-readable description. |
| exit_code | Process exit code to report. |
◆ get_exit_code()
| auto cli::error_t::get_exit_code |
( |
| ) |
const -> int |
|
inlinenodiscard |
Returns the process exit code associated with this error.
- Returns
- The exit code.
◆ get_name()
| auto cli::error_t::get_name |
( |
| ) |
const -> std::string |
|
inlinenodiscard |
Returns the short name of this error type.
- Returns
- The error name, for example "validation_error".
The documentation for this class was generated from the following file:
- /home/mccakit/desktop/repositories/cli11/src/error.cpp