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