diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-22 18:13:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 18:13:47 -0500 |
| commit | 28483bdb54be96ae83e0fded097f534d7e26ba1e (patch) | |
| tree | e7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /SocketHttpListener/WebSocketException.cs | |
| parent | 920c39454c05e979eabe81877269cd4517a03ccf (diff) | |
| parent | 8106c8393b711a7e1d40487e3caf2b014decbe28 (diff) | |
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
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 - } } |
