O'Reilly logo

Mastering Microsoft Dynamics AX 2012 R3 Programming by Mat Fergusson, Simon Buxton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exception handling

Throughout the book, we have raised many exceptions through the throw command, but so far, we have simply allowed this exception to fall through the code, giving our user an error.

This is fine for many cases, but sometimes, we need specific handling. This is especially important when the error is a number of classes deep, and could produce an error message that makes no sense to the user. We may, in these cases, need to provide some context for the message or a different, more useful message for the user.

Handling general exceptions

In the previous section, an error could have been produced in many places, none of which are useful to the user. They are useful to the administrator or developer.

Looking at the code the errors we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required