Catches input output file errors.