StormByte-Network 4.0.0
C++26 networking module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Network::Exception Class Reference

Root exception for Network. More...

#include <StormByte/network/exception.hxx>

Inheritance diagram for StormByte::Network::Exception:
Collaboration diagram for StormByte::Network::Exception:

Classes

struct  Path
 Additional path segments nested below StormByte.Network. More...

Public Member Functions

template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (std::string_view pattern, Args &&... args)
 Replace literal {} under StormByte.Network.
 Exception (std::string_view message)
 Copy a borrowed plain message under StormByte.Network in the provider.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (Path path, std::string_view pattern, Args &&... args)
 Replace literal {} under an additional Network path.
 Exception (Path path, std::string_view message)
 Copy a borrowed plain message under an additional Network path.
 Exception (const Exception &other)
 Copy Base-owned message storage through its provider.
 Exception (Exception &&other) noexcept
 Transfer Base-owned message storage without allocating.
Exception & operator= (const Exception &other)
 Copy Base-owned message storage through its provider.
Exception & operator= (Exception &&other) noexcept
 Transfer Base-owned message storage without allocating.
 ~Exception () noexcept override
 Destroy the exception.
Public Member Functions inherited from StormByte::Exception
 Exception (std::string_view message)
 Exception (const Exception &other)
 Exception (Exception &&other) noexcept
Exception & operator= (const Exception &other)
Exception & operator= (Exception &&other) noexcept
virtual const char * what () const noexcept

Additional Inherited Members

Protected Member Functions inherited from StormByte::Exception
 Exception () noexcept
 Exception (Path path, std::string_view message)
 Exception (Path path, Safe::String &&message)
 Exception (Path path, std::string_view pattern, Args &&... args)

Detailed Description

Root exception for Network.

what() is StormByte.Network: message.

This type applies the Network segment. A further segment is an Path (Connection, Transport.Packet, Transport.Frame). The body does not include the path. Literal {} are replaced by StormByte::Safe::String::ReplaceToken. This does not call std::format. The destructor is defined in this module.

The message constructor takes string_view. A literal, a C string, std::string and Safe::String reach it through their existing conversions. Safe::String converts implicitly.

See also
ConnectionError, ConnectionClosed, PacketError, FrameError

Constructor & Destructor Documentation

◆ Exception() [1/6]

template<typename... Args>
requires (sizeof...(Args) >= 1)
StormByte::Network::Exception::Exception ( std::string_view pattern,
Args &&... args )
inlineexplicit

Replace literal {} under StormByte.Network.

Template Parameters
ArgsViews, numbers, or types that convert to std::string. A number uses std::to_string.
Parameters
patternBody with literal {} tokens. Not a std::format string.
argsReplacements. One per token, in order.

◆ Exception() [2/6]

StormByte::Network::Exception::Exception ( std::string_view message)
explicit

Copy a borrowed plain message under StormByte.Network in the provider.

Parameters
messageException text. Copied during the call and never retained.

◆ Exception() [3/6]

template<typename... Args>
requires (sizeof...(Args) >= 1)
StormByte::Network::Exception::Exception ( Path path,
std::string_view pattern,
Args &&... args )
inlineexplicit

Replace literal {} under an additional Network path.

Template Parameters
ArgsViews, numbers, or types that convert to std::string. A number uses std::to_string.
Parameters
pathAdditional segments nested below StormByte.Network.
patternBody with literal {} tokens. Not a std::format string.
argsReplacements. One per token, in order.

◆ Exception() [4/6]

StormByte::Network::Exception::Exception ( Path path,
std::string_view message )
explicit

Copy a borrowed plain message under an additional Network path.

Parameters
pathAdditional segments nested below StormByte.Network.
messageException text. Not a format string.

◆ Exception() [5/6]

StormByte::Network::Exception::Exception ( const Exception & other)

Copy Base-owned message storage through its provider.

Parameters
otherException to copy.

◆ Exception() [6/6]

StormByte::Network::Exception::Exception ( Exception && other)
noexcept

Transfer Base-owned message storage without allocating.

Parameters
otherException to move from.

◆ ~Exception()

StormByte::Network::Exception::~Exception ( )
overridevirtualnoexcept

Destroy the exception.

Defined in this module so catch matches across a DLL.

Reimplemented from StormByte::Exception.

Member Function Documentation

◆ operator=() [1/2]

Exception & StormByte::Network::Exception::operator= ( const Exception & other)

Copy Base-owned message storage through its provider.

Parameters
otherException to copy.
Returns
This exception.

◆ operator=() [2/2]

Exception & StormByte::Network::Exception::operator= ( Exception && other)
noexcept

Transfer Base-owned message storage without allocating.

Parameters
otherException to move from.
Returns
This exception.

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