Catch exceptions when files can not be written to disk