Try and Except Statements

This is a really cool trick I can definitely see myself using a lot of in the future.  The benefit of using a try-except statement is that a script will finish running provided the error(s) were isolated in the try clause of the statement.  This week's module was also a boost of confidence for me as well because I was able to identify almost all of the errors prior to debugging.  That being said, I became somewhat familiar with how to develop a workflow for debugging efficiently.  

I still have a steep learning curve of understanding all of the methods and functions within different modules; it's akin to learning another phonetic language.  I'm very excited to start developing more complex code, as I've built up quite a library of helpful links and bookmarks to hopefully assist in my future debugging.

I have fairly good attention to detail which helped me identify a lot of errors right away.  Misspellings and capitalized characters stood out to me right away.  I had to look up a few of the functions online to make sure they were supposed to be spelled that way.  For instance, I had to research that arcpy.mp.ArcGISProject was correct; I initially though that there was an 'a' missing between the 'm' and 'p'.  Double checking the filepath in the file explorer saved me a big headache as well.  It was purposefully incorrect in the template, but was easily recognizable after looking for the file's location.

Below's a workflow that I created after getting my head straight about debugging:












Comments

Popular Posts