Catch the type casting exception to indicate that the constant is not a
instance of the given subtype.