During method execution, it is sometimes necessary to abort the processing because an error condition was met. This recipe shows how to do this so that a helpful error message is displayed to the user when a method that writes a file to disk encounters an error.