$darkmode
cloe::utility::TcpReadError Class Reference

#include <tcp_transceiver.hpp>

Inheritance diagram for cloe::utility::TcpReadError:
Collaboration diagram for cloe::utility::TcpReadError:

Public Member Functions

 Error (std::string_view what)
 
template<typename... Args>
 Error (std::string_view format, Args &&... args)
 
- Public Member Functions inherited from cloe::Error
 Error (std::string_view what)
 
template<typename... Args>
 Error (std::string_view format, Args &&... args)
 
const char * what () const noexcept override
 
bool has_explanation () const
 
void set_explanation (std::string explanation)
 
template<typename... Args>
void set_explanation (std::string_view format, Args &&... args)
 
const std::string & explanation () const
 
Error explanation (std::string explanation) &&
 
template<typename... Args>
Error explanation (std::string_view format, Args &&... args) &&
 

Detailed Description

TcpReadError may be thrown when there is an error during reading. It should be used something like this:

tcp_stream_.read(&msg, msg_size)
if (!tcp_stream_) {
  throw TcpReadError(tcp_stream_.error().message());
}

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