mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-18 13:49:59 +01:00
Tweak Fiber.error docs.
This commit is contained in:
@ -7,12 +7,13 @@ A lightweight coroutine. [Here][fibers] is a gentle introduction.
|
|||||||
## Static Methods
|
## Static Methods
|
||||||
|
|
||||||
### Fiber.**abort**(message)
|
### Fiber.**abort**(message)
|
||||||
Raises a runtime error with the provided message, unless `message` is `null`
|
|
||||||
|
Raises a runtime error with the provided message:
|
||||||
|
|
||||||
:::wren
|
:::wren
|
||||||
Fiber.abort(null) // Do nothing.
|
Fiber.abort("Something bad happened.")
|
||||||
Fiber.abort("Something bad happened") // Raise a runtime error with provided messsage.
|
|
||||||
|
|
||||||
|
If the message is `null`, does nothing.
|
||||||
|
|
||||||
### Fiber.**current**
|
### Fiber.**current**
|
||||||
|
|
||||||
@ -136,7 +137,9 @@ Invokes the fiber or resumes the fiber if it is in a paused state and sets
|
|||||||
fiber.call("value") //> value
|
fiber.call("value") //> value
|
||||||
|
|
||||||
### **error***
|
### **error***
|
||||||
Assuming that a fiber has raised an error, `error` returns the error message.
|
|
||||||
|
The error message that was passed when aborting the fiber, or `null` if the
|
||||||
|
fiber has not been aborted.
|
||||||
|
|
||||||
:::wren
|
:::wren
|
||||||
var fiber = Fiber.new {
|
var fiber = Fiber.new {
|
||||||
|
|||||||
Reference in New Issue
Block a user