There are situations where errors can be handled by scripts. For instance, let's say that you are trying to create a file at a certain location during an operation. Say you want to save this file within the Logs directory within your home directory. Your home directory does not contain a Logs directory just yet. You want to make your script handle the creation of the directory if it encounters ItemNotFoundException.
You have the lab directory that you created for use with this book. You need to create a log file within a directory called LogDir, situated within the lab directory. If LogDir does not exist, the script should create it upon encountering the appropriate exception.