e.g
fileExists(file):
try:
whole = readFile file
except IOError as e:
echo "\nCannot read '",file,"': ",e.msg
except:
echo "\nCannot read '",file,"': unidentified error"
else: echo "none"
Runuse like so
