Adding try and catch when deleting files attached to a node.

#2769