StormByte C++ Library: Network module 0.0.9999
StormByte-Network is a StormByte library module for handling and create network connections
Loading...
Searching...
No Matches
exception.hxx
1#pragma once
2
3#include <StormByte/exception.hxx>
4#include <StormByte/network/visibility.h>
5
10namespace StormByte::Network {
15 class STORMBYTE_NETWORK_PUBLIC Exception: public StormByte::Exception {
16 public:
17 template <typename... Args>
18 Exception(const std::string& component, std::format_string<Args...> fmt, Args&&... args):
19 StormByte::Exception("Network::" + component, fmt, std::forward<Args>(args)...) {}
20
24 using StormByte::Exception::Exception;
25 };
26
31 class ConnectionError: public Exception {
32 public:
33 template <typename... Args>
34 ConnectionError(std::format_string<Args...> fmt, Args&&... args):
35 Exception("Connection", fmt, std::forward<Args>(args)...) {}
36
40 using Exception::Exception;
41 };
42
47 class STORMBYTE_NETWORK_PUBLIC ConnectionClosed final: public Exception {
48 public:
49 template <typename... Args>
50 ConnectionClosed(std::format_string<Args...> fmt, Args&&... args):
51 Exception("Connection: Connection closed. " + fmt, std::forward<Args>(args)...) {}
52
56 using Exception::Exception;
57 };
58
63 class STORMBYTE_NETWORK_PUBLIC PacketError final: public Exception {
64 public:
65 template <typename... Args>
66 PacketError(std::format_string<Args...> fmt, Args&&... args):
67 Exception("Transport::Packet: ", fmt, std::forward<Args>(args)...) {}
68
72 using Exception::Exception;
73 };
74
79 class STORMBYTE_NETWORK_PUBLIC FrameError final: public Exception {
80 public:
81 template <typename... Args>
82 FrameError(std::format_string<Args...> fmt, Args&&... args):
83 Exception("Transport::Frame: ", fmt, std::forward<Args>(args)...) {}
84
88 using Exception::Exception;
89 };
90}
The class representing a terminated connection.
Definition exception.hxx:47
The class representing an error in the connection.
Definition exception.hxx:31
The class representing an exception in the network module.
Definition exception.hxx:15
The class representing an error in the packet.
Definition exception.hxx:79
The class representing an error in the packet.
Definition exception.hxx:63
Network-related classes used by the StormByte networking subsystem.