A better string text would be:

"The size (" << objectLength << ") of the value '" << std::string(ptr, objectLength) << "' exceeds the size of the VARCHAR[" << maxLength << "] column."

For objectLength greater than some FULL_STRING_IN_MESSAGE_THRESHOLD (maybe 100?),
std::string(ptr, objectLength)
with
std::string(ptr, FULL_STRING_IN_MESSAGE_THRESHOLD) << "..."

For VARBINARY in general, we can skip the specific value display (to avoid conversion to human readable text) for something like:
"The size (" << objectLength << ") of a value exceeds the size of the VARBINARY[" << maxLength << "] column."