Developer forum

Forum » Integration » Customers able to check out even when exception is thrown

Customers able to check out even when exception is thrown

Mikkel Ulstrup
Reply

Hi,

 

We have a solution running live integration framework 2. We want to stop an order if the ERP fails, but the code checks this boolean to see if it should throw an error:

public static bool EnableThrowExceptions
        {
            get
            {
                return Core.Converter.ToBoolean(Context.Current?.Items?["LiveIntegrationAddInThrowExceptions"]);
            }
            set
            {
                if (Context.Current?.Items != null)
                {
                    Context.Current.Items["LiveIntegrationAddInThrowExceptions"] = value;
                }
            }
        }

I can't find anything setting the "LiveIntegrationAddInThrowExceptions" anywhere, and so it returns false, and the exceptions are never thrown, and the order completes as usual, even if the ERP fails.

Where can I enable this setting?

 

Kind regards

Mikkel Ulstrup


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

It has a setter so it appears like you can set it yourself. However, the property is internal so you can't access it when you're not in the same assembly.

You could try setting the underlying context item in code somewhere:

Context.Current.Items["LiveIntegrationAddInThrowExceptions"] = true;

You can call this from a subscriber or custom code that runs on every request and that has access to the Context.

Hope this helps,

Imar

 

 
Mikkel Ulstrup
Reply

Hi Imar,

 

Yeah thanks! - Just looks like some code or setting is missing, which I rather use. If it exists...

It doesn't seem right, that the code (out of the box) does not throw the exceptions, and just let the orders complete.

 

Kind regards

Mikkel Ulstrup

 

You must be logged in to post in the forum