DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
WebSocketException.cpp
Go to the documentation of this file.
1#include "pch.h"
3#include "System/String.h"
4
5namespace DotNetDupe {
6 namespace System {
7 namespace Net {
8 namespace WebSockets {
9
11 : SystemException(sMessage), m_eWebSocketErrorCode(WebSocketError::Faulted), m_iNativeErrorCode(0) {
13 }
14
16 : SystemException(sMessage), m_eWebSocketErrorCode(eError), m_iNativeErrorCode(0) {
18 }
19
20 WebSocketException::WebSocketException(WebSocketError eError, int iNativeErrorCode, const String& sMessage)
21 : SystemException(sMessage), m_eWebSocketErrorCode(eError), m_iNativeErrorCode(iNativeErrorCode) {
23 }
24
26 : SystemException(String(innerException.What()), innerException), m_eWebSocketErrorCode(eError), m_iNativeErrorCode(0) {
28 }
29
30 WebSocketException::WebSocketException(WebSocketError eError, const String& sMessage, const Exception& innerException)
31 : SystemException(sMessage, innerException), m_eWebSocketErrorCode(eError), m_iNativeErrorCode(0) {
33 }
34
37 return m_eWebSocketErrorCode;
38 }
39
42 return m_iNativeErrorCode;
43 }
44
45 }
46 }
47 }
48}
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Exception thrown when an error occurs during RFC 6455 WebSocket communication or handshakes.
const char * What() const
Gets a message that describes the current exception.
Definition Exception.h:46
Exception()
Initializes a new instance of the Exception class with a default system-supplied message.
Definition Exception.cpp:15
WebSocketException(const String &sMessage)
Constructs a WebSocketException with a custom descriptive error message.
WebSocketError GetWebSocketErrorCode() const
Gets the structured WebSocketError enumeration code.
int GetErrorCode() const
Gets the native operating system error code associated with this exception.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
SystemException()
Initializes a new instance of the SystemException class with a default message.
Definition Exception.cpp:48
WebSocketError
Categorizes errors that occur during WebSocket protocol handshakes, framing, or socket I/O.
@ Faulted
General fault occurred during processing.