diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-28 19:55:29 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-28 19:55:29 -0800 |
commit | c392f10f10b3acfd88182e3c8b2c5ed666f9055a (patch) | |
tree | 1edb31bf6773292c31839e8bcc50f7e8ea4f0a31 | |
parent | eb753bb54aa6aff7d13c29d24730aafb7e41797d (diff) | |
download | txr-c392f10f10b3acfd88182e3c8b2c5ed666f9055a.tar.gz txr-c392f10f10b3acfd88182e3c8b2c5ed666f9055a.tar.bz2 txr-c392f10f10b3acfd88182e3c8b2c5ed666f9055a.zip |
* txr.1: Clarifying semantics of exceptions being thrown in
catch clauses and in finally clauses.
-rw-r--r-- | txr.1 | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -3903,19 +3903,24 @@ exceptions which are a subtype of any one of those exception types. If a try block has more than one catch clause which can match a given exception, the first one will be invoked. -The exception protection of a try block does not extend over the -catch clauses. Once a catch clause is being executed, if it throws -an exception, that exception will not re-enter any catch within the -same try block, even if it matches one. - -Catches are processed prior to finally. - When a catch is invoked, it is of course understood that the main clause did not terminate normally, and so the main clause could not have produced any bindings. +Catches are processed prior to finally. + +If a catch clause itself throws an exception, that exception cannot +be caught by that same clause or its siblings in the same try block. +The catches of that block are no longer visible at that point. +Nevertheless, the catch clauses are still protected by the finally block. +If a catch clause throws, the finally block is still processed. + +If a finally block throws an exception, then it is simply aborted; +the remaining directives in that block are not processed. + So the success or failure of the try block depends on the behavior of the catch -clause or the finally, if there is one. If either of them succeed, then the try block is considered a successful match. +clause or the finally, if there is one. If either of them succeed, then the try +block is considered a successful match. Example: |