When AX throws an error it is of type Exception. This is an enum with a number of different types which are listed here: http://msdn.microsoft.com/en-us/library/exception.aspx. This is pretty much all the info you get. The error message is in the infolog, but there is no relation to the exception.
Quote from http://msdn.microsoft.com/en-us/library/cc967369.aspx:
In X++ the message that is created when an exception is raised is available only in the Infolog, and the message is not directly tied to the exception. In C# the message is the Message member of the System.Exception object.
You can however catch the different kinds of exceptions separately as demonstrated here: http://msdn.microsoft.com/en-us/library/aa893385.aspx
For exceptions coming from clr, you can get the inner exception with the message (see: http://daxmusings.codecrib.com/2013/04/exception-handling-in-dynamics-ax.html)
An extendable Exception class in AX would be great, who knows in future versions...