[RFC]CID 71507: Unchecked return value (CHECKED_RETURN)

Check for the return value of object_to_vim instead of checking for err.set
I didn't look at the source so :+1: 

@tarruda how's this look to you?