diff options
| author | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-13 20:27:29 +0100 |
|---|---|---|
| committer | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-13 20:27:29 +0100 |
| commit | 8fd0bc63b94d6afac2912217b6118b7c2d533333 (patch) | |
| tree | e7ccfc874762249886a797fa97920662db653672 /SocketHttpListener/WebSocketException.cs | |
| parent | 9014e16037e96a24a78ca59e662bc549f114f233 (diff) | |
Visual Studio Reformat: SocketHttpListener
Diffstat (limited to 'SocketHttpListener/WebSocketException.cs')
| -rw-r--r-- | SocketHttpListener/WebSocketException.cs | 105 |
1 files changed, 53 insertions, 52 deletions
diff --git a/SocketHttpListener/WebSocketException.cs b/SocketHttpListener/WebSocketException.cs index 260721317..e86c46d0f 100644 --- a/SocketHttpListener/WebSocketException.cs +++ b/SocketHttpListener/WebSocketException.cs @@ -2,59 +2,60 @@ using System; namespace SocketHttpListener { - /// <summary> - /// The exception that is thrown when a <see cref="WebSocket"/> gets a fatal error. - /// </summary> - public class WebSocketException : Exception - { - #region Internal Constructors - - internal WebSocketException () - : this (CloseStatusCode.Abnormal, null, null) - { - } - - internal WebSocketException (string message) - : this (CloseStatusCode.Abnormal, message, null) - { - } - - internal WebSocketException (CloseStatusCode code) - : this (code, null, null) - { - } - - internal WebSocketException (string message, Exception innerException) - : this (CloseStatusCode.Abnormal, message, innerException) - { - } - - internal WebSocketException (CloseStatusCode code, string message) - : this (code, message, null) - { - } - - internal WebSocketException (CloseStatusCode code, string message, Exception innerException) - : base (message ?? code.GetMessage (), innerException) - { - Code = code; - } - - #endregion - - #region Public Properties - /// <summary> - /// Gets the status code indicating the cause for the exception. + /// The exception that is thrown when a <see cref="WebSocket"/> gets a fatal error. /// </summary> - /// <value> - /// One of the <see cref="CloseStatusCode"/> enum values, represents the status code indicating - /// the cause for the exception. - /// </value> - public CloseStatusCode Code { - get; private set; + public class WebSocketException : Exception + { + #region Internal Constructors + + internal WebSocketException() + : this(CloseStatusCode.Abnormal, null, null) + { + } + + internal WebSocketException(string message) + : this(CloseStatusCode.Abnormal, message, null) + { + } + + internal WebSocketException(CloseStatusCode code) + : this(code, null, null) + { + } + + internal WebSocketException(string message, Exception innerException) + : this(CloseStatusCode.Abnormal, message, innerException) + { + } + + internal WebSocketException(CloseStatusCode code, string message) + : this(code, message, null) + { + } + + internal WebSocketException(CloseStatusCode code, string message, Exception innerException) + : base(message ?? code.GetMessage(), innerException) + { + Code = code; + } + + #endregion + + #region Public Properties + + /// <summary> + /// Gets the status code indicating the cause for the exception. + /// </summary> + /// <value> + /// One of the <see cref="CloseStatusCode"/> enum values, represents the status code indicating + /// the cause for the exception. + /// </value> + public CloseStatusCode Code + { + get; private set; + } + + #endregion } - - #endregion - } } |
