Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
document most exceptional ops
  • Loading branch information
coke committed Oct 4, 2013
1 parent c659ef3 commit 18f113a
Showing 1 changed file with 77 additions and 6 deletions.
83 changes: 77 additions & 6 deletions docs/ops.markdown
Expand Up @@ -26,12 +26,13 @@ of arguments required.
In opcode signatures below, we use the following types, which may not
correspond directly to NQP types.

* int - native int
* num - native float
* str - native string
* Any - an NQP or VM object
* Type - a type object, e.g. `Int`
* Handle - an I/O Handle object
* int - native int
* num - native float
* str - native string
* Any - an NQP or VM object
* Type - a type object, e.g. `Int`
* Exception - an Exception object
* Handle - an I/O Handle object

# Arithmetic Opcodes

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

# Exceptional Opcodes

##backtrace
* `backtrace(Exception $ex)`

Return an array of hashes, describing the backtrace of the given exception.

##backtracestrings
* `backtracestrings(Exception $ex)`

Return an array of strings, describing the backtrace of the given exception.

##die
* `die(str $message)`

Create and throw an exception using the given message.

##getextype
* `getextype(Exception $ex)`

Gets the exception category (`nqp::const::CONTROL_*`)

##getmessage
* `getmessage(Exception $ex)`

Gets the exception message.

##getpayload
* `getpayload(Exception $ex)`

Gets the exception payload.

##exception
* `exception()`

Return the current exception object.

##newexception
* `newexception()`

Return a new exception object.

##resume
* `resume(Exception $ex)`

Resume the exception, if possible.

##rethrow
* `rethrow(Exception $ex)`

Re-throw the exception.

##setextype
* `setextype(Exception $ex, int $type)`

Sets the exception category (`nqp::const::CONTROL_*`)

##setmessage
* `setmessage(Exception $ex, str $message)`

Sets the exception message.

##setpayload
* `setpayload(Exception $ex, Any $obj)`

Sets the exception payload.

##throw
* `throw(Exception $ex)`

Throw the exception.

# Input/Output Opcodes

##closefh
Expand Down

0 comments on commit 18f113a

Please sign in to comment.