[svn:parrot-pdd] r33164 - trunk/docs/pdds

[email protected]
Newsgroups perl.perl6.internals
Message-ID <[email protected]>
Author: tene
Date: Mon Nov 24 14:59:06 2008
New Revision: 33164

Modified:
   trunk/docs/pdds/pdd23_exceptions.pod

Log:
Add missing documentation about resuming from exceptions.
jonathan++ for reporting this.

Modified: trunk/docs/pdds/pdd23_exceptions.pod
==============================================================================
--- trunk/docs/pdds/pdd23_exceptions.pod	(original)
+++ trunk/docs/pdds/pdd23_exceptions.pod	Mon Nov 24 14:59:06 2008
@@ -365,10 +365,20 @@
 exception. Other exceptions at the run-loop level are also generally
 resumable.
 
-  $P0 = new 'String'
-  $P0 = "something bad happened"
-  $P1 = new 'Exception', $P0   # create new exception object
-  throw $P1                      # throw it
+You resume from an exception by invoking the return continuation stored
+in the 'resume' field of the exception.
+
+  push_eh handler
+  $P0 = new 'Exception'          # create new exception object
+  throw $P0                      # throw it
+  pop_eh
+  say "Everything is just fine."
+  .return()
+ handler:
+  .local pmc exception, continuation
+  .get_results (exception)
+  continuation = exception['resume']
+  continuation()
 
 =head1 ATTACHMENTS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.