diff options
| author | Tthecreator <epostvanthomas@kpnmail.nl> | 2019-01-22 15:22:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 15:22:42 +0000 |
| commit | 189b99df16bd4c93cc96422d7282d01d9ff5b82f (patch) | |
| tree | 26d7da95fe3e3b2772b8b39a2463a6c0ac7652fc /SocketHttpListener/WebSocketException.cs | |
| parent | a00c0defa8cb22774f5dc8a7d566eb36ac7307e8 (diff) | |
| parent | edcfd8b565f632088c8b1f826db8e2fbecf9790d (diff) | |
Merge pull request #1 from jellyfin/dev
Update from jellyfin repo
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 - } } |
