throw exception only if object cannot be made into document