If a failure code is assciated with the exception it can be retrieved using the getFailureCode() method.