Author: kjs Date: Sun Nov 30 06:18:44 2008 New Revision: 33362 Modified: trunk/docs/pdds/pdd19_pir.pod trunk/docs/pdds/pdd23_exceptions.pod
Log: [pdd] remove the part about resuming an exception from pdd19: it's not a part of the PIR language. Also, it was also written in better detail in pdd23. Add a section 'Exception Object Interface' to pdd23, of which resuming is one subsection. Retrieving the message is another section. Modified: trunk/docs/pdds/pdd19_pir.pod ============================================================================== --- trunk/docs/pdds/pdd19_pir.pod (original) +++ trunk/docs/pdds/pdd19_pir.pod Sun Nov 30 06:18:44 2008 @@ -680,6 +680,9 @@ continuation() ... +See L<PDD23|pdds/pdd23_exceptions.pod> for accessing the various attributes +of the exception object. + =head2 Syntactic Sugar Any PASM opcode is a valid PIR instruction. In addition, PIR defines some Modified: trunk/docs/pdds/pdd23_exceptions.pod ============================================================================== --- trunk/docs/pdds/pdd23_exceptions.pod (original) +++ trunk/docs/pdds/pdd23_exceptions.pod Sun Nov 30 06:18:44 2008 @@ -226,11 +226,21 @@ Base class of all standard exceptions. Provides no special functionality. Exists for the purpose of C<isa> testing. +=item B<exception;death> + +Exception type that is thrown by the C<die> opcode. See the description of +the C<die> opcode in this document. + =item B<exception;errno> A system error as reported in the C variable C<errno>. Payload is an integer. Message is the return value of the standard C function C<strerror()>. +=item B<exception;exit> + +Exception type that is thrown by the C<exit> opcode. See the description of +the C<exit> opcode in this document. + =item B<exception;math> Generic base class for math errors. @@ -356,7 +366,22 @@ it still keeps the error information out-of-band, instead of mixing the error in with normal return values. }} -=head2 Resuming after Exceptions +=head2 Exception Object Interface + +=head2 Retrieving the Exception Message + +The exception message is stored in the 'message' attribute: + + ... + handler: + .local pmc exception + .local string message + .get_results (exception) + message = exception['message'] + say message + + +=head3 Resuming after Exceptions Exceptions thrown by standard Parrot opcodes (like the one thrown by C<get_hll_global> above or by the C<throw> opcode) are always resumable,