uvco 0.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
uvco::UvcoException Struct Reference

#include <exception.h>

Inheritance diagram for uvco::UvcoException:
Inheritance graph
[legend]
Collaboration diagram for uvco::UvcoException:
Collaboration graph
[legend]

Public Member Functions

 UvcoException (std::string message) noexcept
 
 UvcoException (uv_status status, std::string_view where) noexcept
 
UvcoExceptionoperator= (const UvcoException &) noexcept=default
 
UvcoExceptionoperator= (UvcoException &&) noexcept=default
 
 UvcoException (const UvcoException &) noexcept=default
 
 UvcoException (UvcoException &&) noexcept=default
 
 ~UvcoException () noexcept override=default
 
const char * what () const noexcept override
 Provide information about the error.
 
 operator std::string () const
 Like what().
 

Public Attributes

std::string message
 The error message.
 
std::optional< uv_statusstatus
 

Detailed Description

An UvcoException wraps a numeric libuv status code as well as a message. The status code is automatically converted to a string, which can be obtained using what().

Constructor & Destructor Documentation

◆ UvcoException() [1/4]

uvco::UvcoException::UvcoException ( std::string  message)
explicitnoexcept
15 : message{std::move(message)} {}
std::string message
The error message.
Definition exception.h:35

◆ UvcoException() [2/4]

uvco::UvcoException::UvcoException ( uv_status  status,
std::string_view  where 
)
noexcept
18 : message{fmt::format("UV error {} ({})", uv_err_name(status), where)},
19 status{status} {}
std::optional< uv_status > status
Definition exception.h:38

◆ UvcoException() [3/4]

uvco::UvcoException::UvcoException ( const UvcoException )
defaultnoexcept

◆ UvcoException() [4/4]

uvco::UvcoException::UvcoException ( UvcoException &&  )
defaultnoexcept

◆ ~UvcoException()

uvco::UvcoException::~UvcoException ( )
overridedefaultnoexcept

Member Function Documentation

◆ operator std::string()

uvco::UvcoException::operator std::string ( ) const
explicit

Like what().

23{ return message; }

◆ operator=() [1/2]

UvcoException & uvco::UvcoException::operator= ( const UvcoException )
defaultnoexcept

◆ operator=() [2/2]

UvcoException & uvco::UvcoException::operator= ( UvcoException &&  )
defaultnoexcept

◆ what()

const char * uvco::UvcoException::what ( ) const
overridenoexcept

Provide information about the error.

21{ return message.c_str(); }

Member Data Documentation

◆ message

std::string uvco::UvcoException::message

The error message.

◆ status

std::optional<uv_status> uvco::UvcoException::status

The status. An UvcoException may not be caused by a libuv error, in which case status is nullopt.


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