diff --git a/websocket-sharp/ErrorEventArgs.cs b/websocket-sharp/ErrorEventArgs.cs index d72fb295..5aee4f26 100644 --- a/websocket-sharp/ErrorEventArgs.cs +++ b/websocket-sharp/ErrorEventArgs.cs @@ -26,6 +26,13 @@ */ #endregion +#region Contributors +/* + * Contributors: + * - Frank Razenberg + */ +#endregion + using System; namespace WebSocketSharp @@ -42,8 +49,8 @@ namespace WebSocketSharp { #region Private Fields - private string _message; private Exception _exception; + private string _message; #endregion @@ -63,28 +70,29 @@ namespace WebSocketSharp #endregion #region Public Properties - + /// - /// Gets the error message. + /// Gets the exception that caused the error. /// /// - /// A that represents the error message. + /// A instance that represents the cause of the error, + /// or if the error isn't due to an exception. /// - public string Message { + public Exception Exception { get { - return _message; + return _exception; } } /// - /// Gets the exception that caused the error. + /// Gets the error message. /// - /// A instance that represents the cause of the error, - /// or if the error isn't due to an exception. + /// + /// A that represents the error message. /// - public Exception Exception { + public string Message { get { - return _exception; + return _message; } } diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 521355d5..16d7399a 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -32,6 +32,13 @@ */ #endregion +#region Contributors +/* + * Contributors: + * - Frank Razenberg + */ +#endregion + using System; using System.Collections; using System.Collections.Generic; @@ -856,10 +863,15 @@ namespace WebSocketSharp _messageEventQueue.Enqueue (e); } - private void error (string message, Exception exc = null) + private void error (string message) + { + error (message, null); + } + + private void error (string message, Exception exception) { try { - OnError.Emit (this, new ErrorEventArgs (message, exc)); + OnError.Emit (this, new ErrorEventArgs (message, exception)); } catch (Exception ex) { _logger.Fatal ("An exception has occurred while OnError:\n" + ex.ToString ());