Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::SysError Class Reference

#include <error.hh>

Inheritance diagram for nix::SysError:

Public Member Functions

template<typename... Args>
 SysError (int errNo, const Args &... args)
 
template<typename... Args>
 SysError (const Args &... args)
 

Public Attributes

int errNo
 

Detailed Description

POSIX system error, created using errno, strerror friends.

Throw this, but prefer not to catch this, and catch SystemError instead. This allows implementations to freely switch between this and windows::WinError without breaking catch blocks.

However, it is permissible to catch this and rethrow so long as certain conditions are not met (e.g. to catch only if errNo = EFooBar). In that case, try to also catch the equivalent windows::WinError code.

Todo
Rename this to PosixError or similar. At this point Windows support is too WIP to justify the code churn, but if it is finished then a better identifier becomes moe worth it.

Constructor & Destructor Documentation

◆ SysError() [1/2]

template<typename... Args>
nix::SysError::SysError ( int errNo,
const Args &... args )
inline

Construct using the explicitly-provided error number. strerror will be used to try to add additional information to the message.

◆ SysError() [2/2]

template<typename... Args>
nix::SysError::SysError ( const Args &... args)
inline

Construct using the ambient errno.

Be sure to not perform another errno-modifying operation before calling this constructor!


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