Click or drag to resize

CommunicationOnAfterErpException Field

Occurs after an exception has occurred communicating with the ERP.

Namespace:  Dynamicweb.Ecommerce.LiveIntegration.Notifications
Assembly:  Dynamicweb.Ecommerce.LiveIntegration (in Dynamicweb.Ecommerce.LiveIntegration.dll) Version: 3.0.1
Syntax
public const string OnAfterErpException = "Dynamicweb.Ecommerce.LiveIntegration.Notifications.LiveIntegration.OnAfterErpException"

Field Value

Type: String
Examples
C#
using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Ecommerce.LiveIntegration.Notifications;

namespace Dynamicweb.Ecommerce.LiveIntegration.Examples.Notifications
{    
    /// <summary>
    /// Class CommunicationAfterErpExceptionSubscriber.
    /// </summary>
    /// <seealso cref="NotificationSubscriber" />
    [Subscribe(Communication.OnAfterErpException)]
    public class CommunicationAfterErpExceptionSubscriber : NotificationSubscriber
    {
        /// <summary>
        /// Call to invoke observer.
        /// </summary>
        /// <param name="notification">The notification.</param>
        /// <param name="args">The args.</param>
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var myArgs = (Communication.OnAfterErpExceptionArgs)args;

            // TODO: Add code here
            if (myArgs?.Exception != null)
            {
                Logging.Logger.Instance.Log(Logging.ErrorLevel.Error, "Some error occurred");
            }
        }
    }
}
See Also