B2.1 Programming fundamentalsB2.1.3
How programs use common exception handling techniques
Describe how programs use common exception handling techniques
SL + HL≈ 50 minCommand term: DescribePremium
In this lesson
- Distinguishing syntax, runtime and logic errors
- Describing how try, catch/except and finally blocks handle exceptions
- Recognising common exceptions in Java and Python
- Deciding when to handle an exception and when to check data first
This lesson is part of Premium
Every topic has one free lesson. Premium unlocks every interactive lesson, the exam-style questions at the end of each one, and the rest of Praxis IB.
What's inside
- LearnWhen programs go wrong
- Learntry, catch/except and finally
- CodeCatching an index error
- LearnCommon exceptions
- LabException lab
- CheckWhich kind of error?
- CheckQuick check
- Codefinally after success and after failure
- LearnUsing exception handling well
- CodeRaising an exception
- ExamWorked exam answer
- ReviewMistakes examiners see
- Exam practiceExam-style questions
Ends with 5 exam-style questions worth 14 marks, with a self-marking markscheme.