uvw 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
uvw::error_event Struct Reference

Error event. More...

#include <emitter.h>

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Error event.

Custom wrapper around error constants of libuv.

Definition at line 23 of file emitter.h.

Member Function Documentation

◆ code()

int uvw::error_event::code ( ) const
noexcept

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

Returns
The underlying error code.

◆ name()

const char * uvw::error_event::name ( ) const
noexcept

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.

◆ operator bool()

uvw::error_event::operator bool ( ) const
explicitnoexcept

Checks if the event contains a valid error code.

Returns
True in case of success, false otherwise.

◆ translate()

static int uvw::error_event::translate ( int  sys)
staticnoexcept

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.

◆ what()

const char * uvw::error_event::what ( ) const
noexcept

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.

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