chore: improve contents.takeHeapSnapshot
error messages
#37459
Merged
contents.takeHeapSnapshot
error messages
#37459