initial
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include <exception>
|
||||
|
||||
namespace tw::net {
|
||||
|
||||
class SocketException : public std::exception {
|
||||
int m_errno;
|
||||
|
||||
public:
|
||||
|
||||
int errno() {
|
||||
return m_errno;
|
||||
}
|
||||
|
||||
SocketException() {
|
||||
}
|
||||
|
||||
SocketException(int errno) :
|
||||
m_errno(errno)
|
||||
{ }
|
||||
|
||||
const char* what() const noexcept override {
|
||||
return std::strerror(m_errno);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user