-
Notifications
You must be signed in to change notification settings - Fork 0
API Error
Liu.Yandong.Hanks edited this page Aug 21, 2026
·
3 revisions
Throwable script error value with a captured stack.
Error creates values that can be thrown. The runtime keeps the message and the script call stack, which makes it the right way to report a condition the caller cannot continue past.
Tip
Throw only for genuinely unrecoverable conditions. An expected "not found" outcome is usually better expressed as null or an agreed sentinel value.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
message |
string |
Yes | Text describing the failure. |
Returns
Error — a throwable error value carrying the message and the captured script stack.
Example
func requirePositive(value) {
if (value <= 0) throw new Error("value must be positive");
return value;
}
return requirePositive(3); // 3AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License