Exceptions in AX 2012
AX 2012 has an Exception system enum which cannot be modified. That means we cannot add any new exception types. AX throws these exceptions in following conditions.
Here are these types:
Info: Thrown when a message is sent to infolog. Developers should not throw this exception manually.
Warning: Thrown when something illegal has occurred which is non-fatal
Deadlock: Thrown when a database deadlock has occurred. Like when many transactions are waiting for one another.
Error: Thrown when something fatal error has occurred stopping all the transactions.
Break: Thrown when the user has pressed CTRL + C or Break during run time.
Internal: Thrown when something goes wrong with the development in run time.
DDEerror: Thrown when an error occurs in the DDE system class. DDE is Dynamic data exchange which is a inter process communication to exchange data between different applications.
Numeric: Thrown when a error occurs in a numerical functions.
CLRError: Thrown when an error occurs during the use of common language runtime functionality.
CodeAccessSecurity: Thrown when a problem occurs during the use of CodeAccessPermission.demand.
(CodeAccessPermission.demand is used to check whether the permissions required to access an API is granted to the calling code.
UpdateConflict: Thrown when a record is updated using Optimistic concurrency control when the recVersion of buffer and database are not equal. The trasaction can be retried. (Use a retry statement in the Catch block)
UpdateConflictNotRecovered: Thrown when a transaction is not completed which is using Optimistic concurrency control. The transaction cannot be retried.