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.

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

◆ 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.

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

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