

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Handling Errors
incomplete
2: Bugs vs. Errors
incomplete
This lesson's interactive features are locked, please to keep using them
Click to play video
Error handling is not the same as debugging. Likewise, errors are not the same as bugs.
"Debugging" a program is the process of going through your code to find where it is not behaving as expected. Debugging is a manual process performed by the developer. Sometimes developers use special software called a "debugger" to help them find bugs, but often they just use print statements to figure out what's going on.
Examples of debugging:
"Error handling" is code that can handle expected edge cases in your program. Error handling is an automated process that we design into our production code to protect it from things like weak internet connections, bad user input, or bugs in other people's code that we have to interface with.
Examples of error handling:
error values and returning early or logging themnilIf your code has a bug, errors won't help you. You need to just go find the bug and fix it.
If something out of your control can produce issues in your code, you should use error-handling logic to deal with it.
For example, there could be a prompt in Jello for users to update their role, but we don't want them to use punctuation. Validating their input and displaying an error message if something is wrong with it would be a form of "error handling".