Retrieves the failure reason as the specified enum type.
The enum value if the reason is of the correct type, null otherwise
The expected enum type