Dealing with Errors3:16 with Alena Holligan
Even the most seasoned professional mis-types or forgets something. Sometimes resources your program requires may not be accessible; or, a user may interact with our application in a way we never intended. So how do we find and address those issues?
Installing a Local Development Environment
Fundamental Types of Errors in Software:
1. Internal Errors: These are the logic errors in your code. These errors can be prevented to a very large degree by careful programming.
2. External Errors: These are errors related to the interactions with the world outside your code. These include things such as failing to open a file or database, dropping the network connection, being unable to load a certain PHP module and more. You can't always avoid these types of errors , but their impact can be mitigated. The better you prepare your code for these external errors, the less these errors will negatively affect your program.
Addressing the Issues
1. Log or Report the Error: Store errors in a log file and alerts people as they come up.
2. Display the Error: Show errors to a developer and/or user when the program is being executed.
3. Act on the Error: Certain levels, or types of errors can trigger different tasks, such as logging a ticket, sending an email or alerting an on call team.
4. Ignore the Error: DANGER! Ignoring errors can be very dangerous and hard to fix later, so try to avoid this when possible.
You need to sign up for Treehouse in order to download course files.Sign up