Skip to content

Commit 18f113a

Browse files
committed
document most exceptional ops
1 parent c659ef3 commit 18f113a

File tree

1 file changed

+77
-6
lines changed

1 file changed

+77
-6
lines changed

docs/ops.markdown

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ of arguments required.
2626
In opcode signatures below, we use the following types, which may not
2727
correspond directly to NQP types.
2828

29-
* int - native int
30-
* num - native float
31-
* str - native string
32-
* Any - an NQP or VM object
33-
* Type - a type object, e.g. `Int`
34-
* Handle - an I/O Handle object
29+
* int - native int
30+
* num - native float
31+
* str - native string
32+
* Any - an NQP or VM object
33+
* Type - a type object, e.g. `Int`
34+
* Exception - an Exception object
35+
* Handle - an I/O Handle object
3536

3637
# Arithmetic Opcodes
3738

@@ -407,6 +408,76 @@ Return a string containing `$count` copies of the string.
407408

408409
# Exceptional Opcodes
409410

411+
##backtrace
412+
* `backtrace(Exception $ex)`
413+
414+
Return an array of hashes, describing the backtrace of the given exception.
415+
416+
##backtracestrings
417+
* `backtracestrings(Exception $ex)`
418+
419+
Return an array of strings, describing the backtrace of the given exception.
420+
421+
##die
422+
* `die(str $message)`
423+
424+
Create and throw an exception using the given message.
425+
426+
##getextype
427+
* `getextype(Exception $ex)`
428+
429+
Gets the exception category (`nqp::const::CONTROL_*`)
430+
431+
##getmessage
432+
* `getmessage(Exception $ex)`
433+
434+
Gets the exception message.
435+
436+
##getpayload
437+
* `getpayload(Exception $ex)`
438+
439+
Gets the exception payload.
440+
441+
##exception
442+
* `exception()`
443+
444+
Return the current exception object.
445+
446+
##newexception
447+
* `newexception()`
448+
449+
Return a new exception object.
450+
451+
##resume
452+
* `resume(Exception $ex)`
453+
454+
Resume the exception, if possible.
455+
456+
##rethrow
457+
* `rethrow(Exception $ex)`
458+
459+
Re-throw the exception.
460+
461+
##setextype
462+
* `setextype(Exception $ex, int $type)`
463+
464+
Sets the exception category (`nqp::const::CONTROL_*`)
465+
466+
##setmessage
467+
* `setmessage(Exception $ex, str $message)`
468+
469+
Sets the exception message.
470+
471+
##setpayload
472+
* `setpayload(Exception $ex, Any $obj)`
473+
474+
Sets the exception payload.
475+
476+
##throw
477+
* `throw(Exception $ex)`
478+
479+
Throw the exception.
480+
410481
# Input/Output Opcodes
411482

412483
##closefh

0 commit comments

Comments
 (0)