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

  1. LearnWhen programs go wrong
  2. Learntry, catch/except and finally
  3. CodeCatching an index error
  4. LearnCommon exceptions
  5. LabException lab
  6. CheckWhich kind of error?
  7. CheckQuick check
  8. Codefinally after success and after failure
  9. LearnUsing exception handling well
  10. CodeRaising an exception
  11. ExamWorked exam answer
  12. ReviewMistakes examiners see
  13. Exam practiceExam-style questions

Ends with 5 exam-style questions worth 14 marks, with a self-marking markscheme.