Fix a few for pull request #69

master
sta 11 years ago
parent 8b2ff1012a
commit e41e627ebc

@ -26,6 +26,13 @@
*/ */
#endregion #endregion
#region Contributors
/*
* Contributors:
* - Frank Razenberg <frank@zzattack.org>
*/
#endregion
using System; using System;
namespace WebSocketSharp namespace WebSocketSharp
@ -42,8 +49,8 @@ namespace WebSocketSharp
{ {
#region Private Fields #region Private Fields
private string _message;
private Exception _exception; private Exception _exception;
private string _message;
#endregion #endregion
@ -63,28 +70,29 @@ namespace WebSocketSharp
#endregion #endregion
#region Public Properties #region Public Properties
/// <summary> /// <summary>
/// Gets the error message. /// Gets the exception that caused the error.
/// </summary> /// </summary>
/// <value> /// <value>
/// A <see cref="string"/> that represents the error message. /// A <see cref="System.Exception"/> instance that represents the cause of the error,
/// or <see langword="null"/> if the error isn't due to an exception.
/// </value> /// </value>
public string Message { public Exception Exception {
get { get {
return _message; return _exception;
} }
} }
/// <summary> /// <summary>
/// Gets the exception that caused the error. /// Gets the error message.
/// </summary> /// </summary>
/// A <see cref="Exception"/> instance that represents the cause of the error, /// <value>
/// or <see langword="null"/> if the error isn't due to an exception. /// A <see cref="string"/> that represents the error message.
/// </value> /// </value>
public Exception Exception { public string Message {
get { get {
return _exception; return _message;
} }
} }

@ -32,6 +32,13 @@
*/ */
#endregion #endregion
#region Contributors
/*
* Contributors:
* - Frank Razenberg <frank@zzattack.org>
*/
#endregion
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@ -856,10 +863,15 @@ namespace WebSocketSharp
_messageEventQueue.Enqueue (e); _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 { try {
OnError.Emit (this, new ErrorEventArgs (message, exc)); OnError.Emit (this, new ErrorEventArgs (message, exception));
} }
catch (Exception ex) { catch (Exception ex) {
_logger.Fatal ("An exception has occurred while OnError:\n" + ex.ToString ()); _logger.Fatal ("An exception has occurred while OnError:\n" + ex.ToString ());

Loading…
Cancel
Save