Exception Handling in C Without C++
By Tom Schotland and Peter Petersen
, November 01, 2000
Error handling is an important issue in embedded systems, and can account for a substantial portion of a project's code. Our authors describe how they designed and implemented an exception-handling library.
Nov00: Exception Handling in C Without C++
XTRY
case XCODE
// code body
break;
[case ERROR_1:
// handler for ERROR_1
break;
// more handlers go here
...]
default:
// handle all other errors
break;
case XFINALLY:
// finally handler
XEND or XENDX
Example 4: The basic structure of an XTRY block.