Debugging and Errors
This week our lessons were on debugging and solving errors
in script. I am a rather avid puzzle fan so I was actually looking forward to
this lesson immensely. It proved to be a bit challenging but with some trial
and error I was able to figure things out.
Reading through the 2nd script, I recognized the issue on Line 6 right away as “Filepath” was incorrectly capitalized. What was the real pain was the following error:
OSError: S:/GISProgramming/Module3/Results/Austin_TX.aprx
It must have taken me almost an hour to figure out that I didn’t have my .aprx file in the right location. When I had extracted the data file into my S: drive, I failed to notice that there was an extra folder that was generated within the results folder. This was such a simple oversite that resulted into an unfortunate hour of repetitive searching. As terrible as that was, I am glad it happened as it became a valuable learning lesson.
The 3rd script was definitely the grand finale for this lab. I had never used “except” before in script, and it took me a while to understand the logic behind how to use this. The primary thing was remembering that I had to write and exception for 'e'. I remembered to add it under Part A, but since it was generic, I thought it would apply to the whole code. I kept getting error messages until I realized I needed to actually write it in respect to both Part A AND Part B. This will definitely be something I take note on in the future when I need to write exceptions.
Comments
Post a Comment