aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/WebSocketException.cs
diff options
context:
space:
mode:
authorLogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com>2019-01-23 00:31:35 -0800
committerGitHub <noreply@github.com>2019-01-23 00:31:35 -0800
commit404bd04cbc17dc8c8bf4a5c9aa3ca9c5cd85aa68 (patch)
tree3d267c6ceef9439a034c113095e10e4d619e7c70 /SocketHttpListener/WebSocketException.cs
parent8ff89fdc0c30f595a171ffc550f907ef22b6212a (diff)
parente05e002b8bb4d13eb2b80b56a0aad8903ddb701e (diff)
Merge pull request #8 from jellyfin/master
rebase to latest master
Diffstat (limited to 'SocketHttpListener/WebSocketException.cs')
-rw-r--r--SocketHttpListener/WebSocketException.cs105
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
- }
}