Files
Towards/modules/network/include/exception/SocketException.hpp
T

30 lines
396 B
C++
Raw Normal View History

2026-07-18 14:31:15 +02:00
#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);
}
};
}