Sponge
CS144's user-space TCP library
Public Member Functions | Private Attributes | List of all members
tagged_error Class Reference

std::system_error plus the name of what was being attempted More...

#include <util.hh>

Inheritance diagram for tagged_error:
Inheritance graph
[legend]

Public Member Functions

 tagged_error (const std::error_category &category, const std::string &attempt, const int error_code)
 Construct from a category, an attempt, and an error code. More...
 
const char * what () const noexcept override
 Returns a C string describing the error. More...
 
- Public Member Functions inherited from std::system_error
system_error (T... args)
 
code (T... args)
 
what (T... args)
 

Private Attributes

std::string _attempt_and_error
 What was attempted, and what happened. More...
 

Detailed Description

std::system_error plus the name of what was being attempted

Definition at line 16 of file util.hh.

Constructor & Destructor Documentation

◆ tagged_error()

tagged_error::tagged_error ( const std::error_category category,
const std::string attempt,
const int  error_code 
)
inline

Construct from a category, an attempt, and an error code.

Parameters
[in]categoryis the category of error
[in]attemptis what was supposed to happen
[in]error_codeis the resulting error

Definition at line 25 of file util.hh.

Member Function Documentation

◆ what()

const char* tagged_error::what ( ) const
inlineoverridenoexcept

Returns a C string describing the error.

Definition at line 29 of file util.hh.

Member Data Documentation

◆ _attempt_and_error

std::string tagged_error::_attempt_and_error
private

What was attempted, and what happened.

Definition at line 18 of file util.hh.


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