uvw  2.2.0
Public Member Functions | Static Public Member Functions | List of all members
uvw::ErrorEvent Struct Reference

The ErrorEvent event. More...

#include <emitter.hpp>

Public Member Functions

const char * what () const noexcept
 Returns the error message for the given error code. More...
 
const char * name () const noexcept
 Returns the error name for the given error code. More...
 
int code () const noexcept
 Gets the underlying error code, that is an error constant of libuv. More...
 
 operator bool () const noexcept
 Checks if the event contains a valid error code. More...
 

Static Public Member Functions

static int translate (int sys) noexcept
 Returns the libuv error code equivalent to the given platform dependent error code. More...
 

Detailed Description

The ErrorEvent event.

Custom wrapper around error constants of libuv.

Definition at line 23 of file emitter.hpp.

Member Function Documentation

◆ code()

int uvw::ErrorEvent::code ( ) const
inlinenoexcept

Gets the underlying error code, that is an error constant of libuv.

Returns
The underlying error code.

Definition at line 67 of file emitter.hpp.

◆ name()

const char* uvw::ErrorEvent::name ( ) const
inlinenoexcept

Returns the error name for the given error code.

Leaks a few bytes of memory when you call it with an unknown error code.

Returns
The error name for the given error code.

Definition at line 61 of file emitter.hpp.

◆ operator bool()

uvw::ErrorEvent::operator bool ( ) const
inlineexplicitnoexcept

Checks if the event contains a valid error code.

Returns
True in case of success, false otherwise.

Definition at line 73 of file emitter.hpp.

◆ translate()

static int uvw::ErrorEvent::translate ( int  sys)
inlinestaticnoexcept

Returns the libuv error code equivalent to the given platform dependent error code.

It returns:

  • POSIX error codes on Unix (the ones stored in errno).
  • Win32 error codes on Windows (those returned by GetLastError() or WSAGetLastError()).

If sys is already a libuv error code, it is simply returned.

Parameters
sysA platform dependent error code.
Returns
The libuv error code equivalent to the given platform dependent error code.

Definition at line 41 of file emitter.hpp.

◆ what()

const char* uvw::ErrorEvent::what ( ) const
inlinenoexcept

Returns the error message for the given error code.

Leaks a few bytes of memory when you call it with an unknown error code.

Returns
The error message for the given error code.

Definition at line 52 of file emitter.hpp.


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