GIS5103 - Debugging and Error Handling

 During module 2 of GIS Programming we learned about fixing errors. In particular we were taught of various ways of identifying errors and how to handle them. The first method of identifying errors included simply running the script to see the error presented if the script failed to run. The error presented states the type of error and tells the user which line of the script it can be found on. The second method, referred to a debugging, runs the script line by line allowing the user to pinpoint the issue(s). We also learned how to implement a try-except statement. A try-except statement in placed strategically in the script to handle the error, allowing the script to successfully run with the error present. An exception is made for the error. 

This week we were tasked with fixing the errors in three scripts. The first script had a few syntax errors or spelling errors. Below is an image of the successful result and an accompanying flow chart. 


The second script had a combination of errors, including syntax errors, and exceptions. Below is an image of the successful result and flow chart. 


The third and final script for Module 2 also had errors and exceptions. However, we were tasked with including try-except statements to handle the errors instead of fixing them. The try-except statements allowed part A the script to run while containing errors, and then part B which should not have had any errors. I did have a slight issue with part B not running correctly but this was easily fixed by fixing an error in the referenced file location. Below is an image of the successful result and flow chart. 






Comments

Popular posts from this blog

GIS 5935 - Data Quality Assessment

GIS 5935 - Surfaces - TINs and DEMs

GIS 5100 - Who is Gabrielle Hudson?