![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <system-error.hh>
Additional Inherited Members | |
| Public Types inherited from nix::NativeCodeSystemError< SysErrorFields, &SysErrorFields::errNo > | |
| using | NativeCode |
| Public Member Functions inherited from nix::CloneableError< SysError, NativeCodeSystemError< SysErrorFields, &SysErrorFields::errNo > > | |
| void | throwClone () const override |
| Public Member Functions inherited from nix::NativeCodeSystemError< SysErrorFields, &SysErrorFields::errNo > | |
| NativeCodeSystemError (NativeCode code, Args &&... args) | |
| Public Member Functions inherited from nix::SystemError | |
| SystemError (std::error_code errorCode, const HintFmt &hf) | |
| template<typename... Args> | |
| SystemError (std::error_code errorCode, Args &&... args) | |
| const std::error_code | ec () const & |
| bool | is (std::errc e) const |
| template<std::same_as< std::errc >... Rest> | |
| bool | is (std::errc e, Rest... rest) const |
| Public Member Functions inherited from nix::CloneableError< SystemError, Error > | |
| void | throwClone () const override |
| Public Member Functions inherited from nix::BaseError | |
| BaseError (const BaseError &)=default | |
| BaseError & | operator= (const BaseError &)=default |
| BaseError & | operator= (BaseError &&) noexcept=default |
| template<typename... Args> | |
| BaseError (unsigned int status, Args &&... args) | |
| template<typename... Args> | |
| BaseError (const std::string &fs, Args &&... args) | |
| template<typename... Args> | |
| BaseError (const Suggestions &sug, Args &&... args) | |
| BaseError (HintFmt hint) | |
| BaseError (ErrorInfo &&e) | |
| BaseError (const ErrorInfo &e) | |
| std::string | message () const |
| const char * | what () const noexcept override |
| const std::string & | msg () const |
| const ErrorInfo & | info () const |
| void | withExitStatus (unsigned int status) |
| void | atPos (std::shared_ptr< const Pos > pos) |
| bool | hasPos () const |
| void | pushTrace (Trace trace) |
| template<typename... Args> | |
| void | addTrace (std::shared_ptr< const Pos > &&pos, std::string_view fs, Args &&... args) |
| void | addTrace (std::shared_ptr< const Pos > &&pos, HintFmt hint, TracePrint print=TracePrint::Default) |
| bool | hasTrace () const |
| ErrorInfo & | unsafeInfo () |
| void | recalcWhat () const |
| Static Public Member Functions inherited from nix::SysErrorFields | |
| static int | ambientError () |
| static std::error_code | toErrorCode (int code) |
| static std::string | renderError (int code) |
| Public Attributes inherited from nix::SysErrorFields | |
| int | errNo |
| Protected Member Functions inherited from nix::SystemError | |
| SystemError (DisambigHintFmt, std::error_code errorCode, std::string_view errorDetails, const HintFmt &hf) | |
| template<typename... Args> | |
| SystemError (DisambigVarArgs, std::error_code errorCode, std::string_view errorDetails, Args &&... args) | |
| Protected Member Functions inherited from nix::BaseError | |
| const std::string & | calcWhat () const |
| Protected Attributes inherited from nix::BaseError | |
| ErrorInfo | err |
| std::optional< std::string > | what_ |
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.