
The bright
side of
exceptions
Didier Verna
Introduction
Basic Error
Handling
Catching and
throwing errors
Defining errors
Advanced
Error Handling
Restarts
Dynamic error
management
Beyond Error
Handling
Warnings
Signals
Conclusion
The Truth about warn
The true truth about error
The function warn:
1 establishes a muffle-warning restart
2 calls signal to signal the condition
3 eventually prints the condition and returns
The function [c]error:
1 [establishes a continue restart]
2 calls signal to signal the condition
3 eventually invokes the debugger
The function signal:
1 looks for an appropriate handler
•
may handle the error (non-local exit)
•
may not (decline by returning)
2 simply returns otherwise
User-defined protocols on top of signal
17/20