/// <summary> /// Logs information from the specified <see cref="IErrorInfo"/> instance. /// </summary> /// <param name="logger">The logger to use.</param> /// <param name="errorInfo">The <see cref="IErrorInfo"/> instance to log to.</param> /// <param name="ex">The exception to log, if any.</param> public static void LogErrorInfo(this ILog logger, IErrorInfo errorInfo, Exception ex = null) { if (ex == null) { logger.Debug(errorInfo.ToErrorMessage()); } else { logger.Debug(errorInfo.ToErrorMessage(), ex); } }
/// <summary> /// Initializes a new instance of the <see cref="EtpException"/> class. /// </summary> /// <param name="protocol">The protocol the exception occurred on.</param> /// <param name="errorInfo">The error info.</param> /// <param name="correlatedHeader">The message header that the exception to send is correlated with, if any.</param> /// <param name="innerException">The inner exception.</param> public EtpException(int protocol, IErrorInfo errorInfo, IMessageHeader correlatedHeader = null, Exception innerException = null) : base(errorInfo.ToErrorMessage(), innerException) { Protocol = protocol; ErrorInfo = errorInfo; CorrelatedHeader = correlatedHeader; }