Throwing an exception if the object is not of a supported type, instead of failing silently.