Botan 3.13.0
Crypto and TLS for C&
Botan::System_Error Class Reference

#include <exceptn.h>

Inheritance diagram for Botan::System_Error:
Botan::Exception

Public Member Functions

int error_code () const noexcept override
ErrorType error_type () const noexcept override
 System_Error (std::string_view msg)
 System_Error (std::string_view msg, int err_code)
const char * what () const noexcept override

Detailed Description

System_Error

This exception is thrown in the event of an error related to interacting with the operating system.

This exception type also (optionally) captures an integer error code eg POSIX errno or Windows GetLastError.

Definition at line 435 of file exceptn.h.

Constructor & Destructor Documentation

◆ System_Error() [1/2]

Botan::System_Error::System_Error ( std::string_view msg)
inlineexplicit

Create a System_Error exception

Parameters
msga description of the problem

Definition at line 441 of file exceptn.h.

441: Exception(msg), m_error_code(0) {}
Exception(std::string_view msg)
Definition exceptn.cpp:71

References Botan::Exception::Exception().

◆ System_Error() [2/2]

Botan::System_Error::System_Error ( std::string_view msg,
int err_code )

Create a System_Error exception

Parameters
msga description of the problem
err_codethe operating system error code

Definition at line 137 of file exceptn.cpp.

137 :
138 Exception(fmt("{} error code {}", msg, err_code)), m_error_code(err_code) {}
std::string fmt(std::string_view format, const T &... args)
Definition fmt.h:53

References Botan::Exception::Exception(), and Botan::fmt().

Member Function Documentation

◆ error_code()

int Botan::System_Error::error_code ( ) const
inlineoverridevirtualnoexcept

Return the operating system error code associated with this exception

Returns
the operating system error code captured at construction

Reimplemented from Botan::Exception.

Definition at line 460 of file exceptn.h.

460{ return m_error_code; }

◆ error_type()

ErrorType Botan::System_Error::error_type ( ) const
inlineoverridevirtualnoexcept

Return the error type of this exception

Returns
the error type of this exception

Reimplemented from Botan::Exception.

Definition at line 454 of file exceptn.h.

454{ return ErrorType::SystemError; }

References Botan::SystemError.

◆ what()

const char * Botan::Exception::what ( ) const
inlineoverridenoexceptinherited

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