2.2. Escalate Errors

Intent

Enhance your error handling by using the Symbian OS Leave mechanism to escalate the responsibility of handling an error up to the point which has enough context to resolve the error.

AKA

Leave and Trap, Error Propagation, Exception Handling, and Separating Error-Handling Code from 'Regular' Code

2.2.1. Problem

2.2.1.1. Context

Your component is part of or contains a layered software stack[] and has to appropriately handle non-fatal domain or system errors.

[] As per the Layers pattern described in [Buschmann et al., 1996] or Model–View–Controller (see page 332).

2.2.1.2. Summary
  • Non-fatal errors must be resolved appropriately so that an application or service can continue to provide the functionality the user expects.

  • There should be a clear separation between code for error handling and the normal flow of execution to reduce development time and maintenance costs by reducing code complexity and increasing software clarity.

  • Error-handling code should not have a significant impact at run time during normal operation.

2.2.1.3. Description

Most well-written software is layered so that high-level abstractions depend on low-level abstractions. For instance, a browser interacts with an end user through its UI code at the highest levels of abstraction. Each time the end user requests a new web page, that request is given to the HTTP subsystem which in turn hands the request to the IP stack at a lower level. At any stage, an error might be encountered that ...

Get Common Design Patterns for Symbian OS: The Foundations of Smartphone Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.