LLFIO  v2.00
llfio_v2_xxx::error_info Struct Reference

The cause of the failure of an operation in LLFIO. More...

#include "status_code.hpp"

Public Member Functions

 error_info ()=default
 Default constructor.
 
 error_info (std::error_code _ec)
 
 OUTCOME_TEMPLATE (class ErrorCondEnum) OUTCOME_TREQUIRES(OUTCOME_TPRED(std
 Implicit construct from an error condition enum.
 
int value () const noexcept
 Retrieve the value of the error code.
 
filesystem::path path1 () const
 Retrieve any first path associated with this failure. Note this only works if called from the same thread as where the failure occurred.
 
filesystem::path path2 () const
 Retrieve any second path associated with this failure. Note this only works if called from the same thread as where the failure occurred.
 
std::string message () const
 
void throw_exception () const
 

Friends

std::error_code make_error_code (error_info ei)
 

Detailed Description

The cause of the failure of an operation in LLFIO.

Member Function Documentation

◆ message()

std::string llfio_v2_xxx::error_info::message ( ) const
inline

Retrieve a descriptive message for this failure, possibly with paths and stack backtraces. Extra detail only appears if called from the same thread as where the failure occurred.

485  {
486  std::string ret(ec.message());
487 #if !LLFIO_DISABLE_PATHS_IN_FAILURE_INFO
488  detail::append_path_info(*this, ret);
489 #endif
490  return ret;
491  }

◆ throw_exception()

void llfio_v2_xxx::error_info::throw_exception ( ) const
inline

Throw this failure as a C++ exception. Firstly if the error code matches any of the standard C++ exception types e.g. bad_alloc, we throw those types using the string from message() where possible. We then will throw an error exception type.

598 {
599  std::string msg;
600  try
601  {
602  msg = message();
603  }
604  catch(...)
605  {
606  }
607  OUTCOME_V2_NAMESPACE::try_throw_std_exception_from_error(ec, msg);
608  throw error(*this);
609 }
std::string message() const
Definition: status_code.hpp:484

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