Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
12.5.4. Error Handling
This section
Practice test
10 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
2 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is error detection?
Hint
Think about how a program knows there was a problem.
- 2.
Name one way to report an error.
Hint
How do we tell someone something went wrong?
- 3.
What is the first step in error handling?
- Error Recognition
- Error Recovery
- Error Reporting
Hint
Think about how you would first notice something went wrong.
- 4.
True or False: Logging is unnecessary for error management.
- True
- False
Hint
Why do we need to remember past issues?
- 5.
Design an error handling mechanism for a temperature sensor reading application that can detect, report, and recover from erroneous readings. Outline the implementation steps.
Hint
Think about how your application will know if something is wrong before responding.
- 6.
Write pseudo-code for a function that handles errors from a UART communication process, indicating possible errors via return codes, logging them and implementing a retry strategy.
Hint
Start with checking the result of the data read operation clearly.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
Get your answers marked and your progress tracked
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting