WPILibC++  2020.3.2-60-g3011ebe
wpi::ECError Class Reference

This class wraps a std::error_code in a Error. More...

#include <Error.h>

Inheritance diagram for wpi::ECError:
wpi::ErrorInfo< ECError > wpi::ErrorInfoBase

Public Member Functions

void setErrorCode (std::error_code EC)
 
std::error_code convertToErrorCode () const override
 Convert this error to a std::error_code. More...
 
void log (raw_ostream &OS) const override
 Print an error message to an output stream.
 
- Public Member Functions inherited from wpi::ErrorInfo< ECError >
const void * dynamicClassID () const override
 
bool isA (const void *const ClassID) const override
 
- Public Member Functions inherited from wpi::ErrorInfoBase
virtual std::string message () const
 Return the error message as a string.
 
template<typename ErrorInfoT >
bool isA () const
 

Static Public Attributes

static char ID
 

Protected Member Functions

 ECError (std::error_code EC)
 

Protected Attributes

std::error_code EC
 

Friends

Error errorCodeToError (std::error_code)
 Helper for converting an std::error_code to a Error.
 

Additional Inherited Members

- Static Public Member Functions inherited from wpi::ErrorInfo< ECError >
static const void * classID ()
 
- Static Public Member Functions inherited from wpi::ErrorInfoBase
static const void * classID ()
 

Detailed Description

This class wraps a std::error_code in a Error.

This is useful if you're writing an interface that returns a Error (or Expected) and you want to call code that still returns std::error_codes.

Member Function Documentation

◆ convertToErrorCode()

std::error_code wpi::ECError::convertToErrorCode ( ) const
inlineoverridevirtual

Convert this error to a std::error_code.

This is a temporary crutch to enable interaction with code still using std::error_code. It will be removed in the future.

Implements wpi::ErrorInfoBase.


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