[svn:parrot] r37494 - trunk/docs/user/pir
tene at svn.parrot.org
tene at svn.parrot.org
Mon Mar 16 19:43:36 UTC 2009
Author: tene
Date: Mon Mar 16 19:43:36 2009
New Revision: 37494
URL: https://trac.parrot.org/parrot/changeset/37494
Log:
Add line breaks for codetest. Coke++
Modified:
trunk/docs/user/pir/exceptions.pod
Modified: trunk/docs/user/pir/exceptions.pod
==============================================================================
--- trunk/docs/user/pir/exceptions.pod Mon Mar 16 19:39:43 2009 (r37493)
+++ trunk/docs/user/pir/exceptions.pod Mon Mar 16 19:43:36 2009 (r37494)
@@ -49,7 +49,10 @@
=head2 Catching exceptions
-Parrot maintains a stack of exception handlers. When an exception is thrown, Parrot iterates through the stack looking for a handler that can handle the exception. When it finds a valid exception handler, the exception handler is invoked with the exception as an argument.
+Parrot maintains a stack of exception handlers. When an exception is
+thrown, Parrot iterates through the stack looking for a handler that
+can handle the exception. When it finds a valid exception handler,
+the exception handler is invoked with the exception as an argument.
You create exception handlers just like you create any other object, with
C<new>.
@@ -57,8 +60,10 @@
.local pmc eh
eh = new 'ExceptionHandler'
-You set the target of the exception handler (the code that will be invoked) with the C<set_attr> opcode. Usually this will be a label.
-You manipulate the exception handler stack with the C<push_eh> and C<pop_eh> opcodes. This is a fairly standard use of exception handlers:
+You set the target of the exception handler (the code that will be
+invoked) with the C<set_attr> opcode. Usually this will be a label.
+You manipulate the exception handler stack with the C<push_eh> and
+C<pop_eh> opcodes. This is a fairly standard use of exception handlers:
.local pmc eh
eh = new 'ExceptionHandler'
@@ -73,9 +78,13 @@
... # code that prints a warning, logs an error, whatever
.return (0) # Failure!
-Sometimes you want to be more specific in what you catch. You can set filters on the exception handler based on exception type and severity. The methods you use include C<.min_severity()>, C<.max_severity()>, C<.handle_types()>, and C<.handle_types_except()>.
+Sometimes you want to be more specific in what you catch. You can set
+filters on the exception handler based on exception type and severity.
+The methods you use include C<.min_severity()>, C<.max_severity()>,
+C<.handle_types()>, and C<.handle_types_except()>.
-Here's an example of a sub that catches only error exceptions and prints an appropriate log message before exiting.
+Here's an example of a sub that catches only error exceptions and prints
+an appropriate log message before exiting.
.sub 'dostuff'
.local pmc eh
More information about the parrot-commits
mailing list