SERVER-8048: catch exception if toString() doesn't exist on an object.