Module 3: Debugging

     Hello all, in this week's GIS Programming assignment, we learned the basics surrounding debugging and error handling procedures. By debugging in a programming sense, we mean that we are removing any obstacles that would prevent the code from running properly. Debugging is crucial in ensuring the code runs smoothly and correctly. As a part of the debugging procedures, we need to understand the error messages that occur when a code does not run smoothly. These error messages will stop the code from being executed until the error is resolved. It is important we understand these messages in order to identify and fix the problem within the code. The code we tested during this lab had the intent of pulling information from ArcGIS Pro. Below is the corrected script's output.


Script #1:

    There are a few errors in the script below. First, we had to address a case-sensitive error in which the case was not consistent with something we defined throughout the script. Secondly, there was an error in which an item was not properly placed in the list, therefore causing the script to stop executing. Then, lastly, two words were switched places, causing the program to not understand what it was being asked to execute. Below is the corrected script's output on what it should look like after these errors are addressed.

Script #2:
    
    In this script, the main error was that the file path was not listed correctly according to the file path that was actually listed on my computer. Therefore, this was the first error that needed to be addressed. After correcting this issue, we still had other syntax errors, such as the case sensitivity as noted in the first script and a backward slash where there needed to be a forward slash. Below is the corrected script output on what it should look like after the errors have been addressed. 


Script #3:

    For this script, we were not actually correcting the errors but instead applying try-except statements so the script would run even with the errors in the script. The image below is the output for that, as you can see it prints where and what the error is in Part A, and for Part B it states Part B was run successfully. I've included the flow chart of the process below the script output. 



Comments

Popular Posts