join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
error.hpp
Go to the documentation of this file.
1
25#ifndef __JOIN_ERROR_HPP__
26#define __JOIN_ERROR_HPP__
27
28// C++.
29#include <system_error>
30
31namespace join
32{
34 extern thread_local std::error_code lastError;
35
55
59 class ErrorCategory : public std::error_category
60 {
61 public:
66 virtual const char* name () const noexcept;
67
73 virtual std::string message (int code) const;
74
81 virtual bool equivalent (const std::error_code& code, int condition) const noexcept;
82 };
83
88 const std::error_category& getErrorCategory ();
89
95 std::error_code make_error_code (join::Errc code);
96
102 std::error_condition make_error_condition (join::Errc code);
103}
104
105namespace std
106{
107 template <> struct is_error_condition_enum <join::Errc> : public true_type {};
108}
109
110#endif
Error category.
Definition error.hpp:60
virtual std::string message(int code) const
Translate error code to human readable error string.
Definition error.cpp:47
virtual bool equivalent(const std::error_code &code, int condition) const noexcept
find equivalent from Errc to system error code.
Definition error.cpp:86
virtual const char * name() const noexcept
Get error category name.
Definition error.cpp:38
Definition acceptor.hpp:32
std::error_code make_error_code(join::Errc code)
Create an std::error_code object.
Definition error.cpp:154
Errc
Generic error codes.
Definition error.hpp:40
const std::error_category & getErrorCategory()
Get error category.
Definition error.cpp:144
thread_local std::error_code lastError
last error.
Definition error.cpp:32
std::error_condition make_error_condition(join::Errc code)
Create an std::error_condition object.
Definition error.cpp:163
Definition error.hpp:106