# Catch the exception of type Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.InvalidAttributePathException

**URL:** <https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802>\
**Category:** Developer Forum\
**Created:** [July 26, 2021, 10:22am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802 "2021-07-26T10:22:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pupadhyay](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pupadhyay](https://www.dynamicsuser.net/u/Pupadhyay)\
**Post date:** [July 26, 2021, 10:22am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/1 "2021-07-26T10:22:20Z")

</div>

I am stuck to catch the Exception for Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.InvalidAttributePathException, InvalidAttributePathException is not showing x++ class so we are not able to create object of this type. Since not able to catch this error it is showing error on the form and not able to log.

Error:-

at Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.Model.GetAttributeByXPath(String attributeXPath, Boolean acceptNoHit)\r\n at Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.Configurator.LoadAttributeValues(AttributeAssignments attributeAssignments)\r\n at Dynamics.AX.Application.PCRuntimeSynchronousConfigurator.`loadAttributeValues() in xppSource://Source/Foundation\\AxClass_PCRuntimeSynchronousConfigurator.xpp:line 124\r\n at Dynamics.AX.Application.PCRuntimeSynchronousConfigurator.loadAttributeValues()\r\n at Dynamics.AX.Application.PCRuntimeSynchronousConfigurator.`configure(String \_model, String \_valuesByXPath, Int32 \_timeoutInMilliseconds, Boolean @\_timeoutInMilliseconds\_IsDefaultSet) in xppSource://Source/Foundation\AxClass\_PCRuntimeSynchronousConfigurator.xpp:line 65\r\n at Dynamics.AX.Application.PCRuntimeSynchronousConfigurator.configure(String \_model, String \_valuesByXPath, Int32 \_timeoutInMilliseconds, Boolean @\_timeoutInMilliseconds\_IsDefaultSet)\r\n at Dynamics.AX.Application.PCRuntimeSynchronousConfigurator.configure(String \_model, String \_valuesByXPath)\r\n at Dynamics.AX.Application.wfsUpdateProductConfiguration.`updateProductLine(SalesLine salesLine) in xppSource://Source/WfsExtension\\AxClass_wfsUpdateProductConfiguration.xpp:line 216\r\n at Dynamics.AX.Application.wfsUpdateProductConfiguration.updateProductLine(SalesLine salesLine)\r\n at Dynamics.AX.Application.WfsNopOrderItem_Extension.Insert(nopOrderItem this) in xppSource://Source/WfsExtension\\AxClass_WfsNopOrderItem_Extension.xpp:line 14\r\n at WfsNopOrderItem_Extension::Insert(Object , Object[] , Boolean& )\r\n at Microsoft.Dynamics.Ax.Xpp.CommonChainOfCommandManager.MakeInstanceCall(Common instance, String methodName, Object[] parameters, Object& returnValue)\r\n at Microsoft.Dynamics.Ax.Xpp.Common.Insert()\r\n at Dynamics.AX.Application.NopSOQueueProcess.`createSalesOrderOrShipment(Int32 \_nopOrderID, JObject \_jb, QueueClient \_queueClient, BrokeredMessage \_messager, Boolean @\_queueClient\_IsDefaultSet, Boolean @\_messager\_IsDefaultSet) in xppSource://Source/nopCommerce\AxClass\_NopSOQueueProcess.xpp:line 796\r\n at Dynamics.AX.Application.NopSOQueueProcess.createSalesOrderOrShipment(Int32 \_nopOrderID, JObject \_jb, QueueClient \_queueClient, BrokeredMessage \_messager, Boolean @\_queueClient\_IsDefaultSet, Boolean @\_messager\_IsDefaultSet)\r\n at Dynamics.AX.Application.NopSOQueueProcess.createSalesOrderOrShipment(Int32 \_nopOrderID, JObject \_jb, QueueClient \_queueClient, BrokeredMessage \_messager)\r\n at Dynamics.AX.Application.NopSOQueueProcess.`run() in xppSource://Source/nopCommerce\\AxClass_NopSOQueueProcess.xpp:line 933\r\n at Dynamics.AX.Application.NopSOQueueProcess.run()\r\n at Dynamics.AX.Application.SysOperationSandbox.`startOperation(SysOperationIMarshalledRun operationInstance) in xppSource://Source/ApplicationPlatform\AxClass\_SysOperationSandbox.xpp:line 100\r\n at Dynamics.AX.Application.SysOperationSandbox.startOperation(SysOperationIMarshalledRun operationInstance)\r\n at Dynamics.AX.Application.Runbase.`runOperation() in xppSource://Source/ApplicationPlatform\\AxClass_Runbase.xpp:line 804\r\n at Dynamics.AX.Application.Runbase.runOperation()\r\n at Dynamics.AX.Application.NopSOQueueProcess.`main(Args args) in xppSource://Source/nopCommerce\AxClass\_NopSOQueueProcess.xpp:line 42\r\n at Dynamics.AX.Application.NopSOQueueProcess.main(Args args)\r\n at NopSOQueueProcess::main(Object[] , Boolean& )\r\n at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [July 26, 2021, 12:18pm UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/2 "2021-07-26T12:18:57Z")

</div>

Could you please start from the beginning and tell us what you’re doing when you got the exception? It seems that you’re writing some custom code, right? If so, you seem to have a bug there, but we can’t comment on your code unless you share it with us.

Yes, Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.InvalidAttributePathException isn’t an X++ class, therefore it’s correct that you don’t see it in AOT. But you’re wrong in thinking that catching an exception requires creating an object. The object is created by code throwing an exception, not the one catching the exception.

You can either catch the specific exception, or all exceptions. For example, this catches all exceptions:

```auto
System.Exception ex;

try
{
    ...
}
catch (ex)
{
    ...
}

```

---

<div class="post-metadata">

**Author:** ![Pupadhyay](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pupadhyay](https://www.dynamicsuser.net/u/Pupadhyay)\
**Post date:** [July 27, 2021, 10:32am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/3 "2021-07-27T10:32:16Z")

</div>

Hi Martin,

Thank you for the reply. I am already doing the same but not getting proper result so thought to create a object that type error. Below is the screenshot of the code. Actually I am trying to update the product configurator in sales line but there is any issue with solver name or value the error is thrown from "PCruntimsync…"class and I am trying log in custom table but the error is not coming in custom catch.

 ![pastedimage1627381748908v1.png](https://us1.discourse-cdn.com/flex023/uploads/dugusers/original/2X/0/0ec428d7ac1289ae94b80ea0f87ca43bb5875c1c.png)

 ![pastedimage1627381880621v3.png](https://us1.discourse-cdn.com/flex023/uploads/dugusers/original/2X/8/856110b48d435a427487f56b7bdc87a27ccae342.png)

![pastedimage1627381786465v2.png](https://us1.discourse-cdn.com/flex023/uploads/dugusers/original/2X/f/f94b40a4e9bff3f2acf20d3471d445f8d9107c31.png)

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [July 28, 2021, 7:24am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/4 "2021-07-28T07:24:50Z")

</div>

I’m sorry, but what am I supposed to see in the screenshots? Does the first one shows that my suggested code actually works?

---

<div class="post-metadata">

**Author:** ![Pupadhyay](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pupadhyay](https://www.dynamicsuser.net/u/Pupadhyay)\
**Post date:** [July 28, 2021, 11:21am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/5 "2021-07-28T11:21:34Z")

</div>

Your code is not working here. In the first screenshot the code is not moving inside of catch block.

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [July 28, 2021, 12:05pm UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/6 "2021-07-28T12:05:27Z")

</div>

As I see the screenshot, it seems to be showing that an exception _has been caught_. It even says which exception it is: System.AggregateException.

---

<div class="post-metadata">

**Author:** ![Pupadhyay](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pupadhyay](https://www.dynamicsuser.net/u/Pupadhyay)\
**Post date:** [July 28, 2021, 12:51pm UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/7 "2021-07-28T12:51:01Z")

</div>

Hi Martin ,

After line number 223 it is not going inside Ln. 224 , it simple exit the method from all the caller classes.

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [July 28, 2021, 4:04pm UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/8 "2021-07-28T16:04:55Z")

</div>

Please make sure that you aren’t trying to catch the exception inside of a transaction. That’s not possible.

Then please create a simple runnable class demonstrating the problem and share the full class with us, so we can run your code and test it.

---

<div class="post-metadata">

**Author:** ![Eric\_Mathew](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@Eric\_Mathew](https://www.dynamicsuser.net/u/Eric_Mathew)\
**Post date:** [August 8, 2025, 7:08am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/12 "2025-08-08T07:08:57Z")

</div>

Hey there! So, this exception you’re seeing (InvalidAttributePathException) actually comes from managed code, not X++. That means you can’t catch it directly in X++ with a try/catch block, which is why it pops up as an unhandled error on the form. The workaround is to wrap the X++ call that triggers this exception in a try/catch block and catch a generic Exception or CLRObject. From there, you can log it or handle it safely, but just keep in mind that you won’t be able to catch the specific .NET type directly. If you’d like, I can show you an example of how to set that up in X++.

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [August 8, 2025, 9:07am UTC](https://www.dynamicsuser.net/t/catch-the-exception-of-type-microsoft-dynamics-ax-frameworks-controls-productconfiguration-invalidattributepathexception/68802/13 "2025-08-08T09:07:07Z")

</div>

Eric, you said that managed exceptions can’t by caught by try/catch and then you suggested using try/catch. One of that must be wrong and it’s the first part - managed exceptions _can_ be caught in X++. In F&O (which the question is about), you can use the _catch_ statement to catch specific managed exceptions directly.

The suggestion to catch _CLRObject_ is wrong; it can’t be done. You could catch _Exception::CLRError_, as it was the only option in older version, but catching the managed exception type is much better.

By the way, notice that this thread is four years old.
