Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 604 Bytes

error.md

File metadata and controls

31 lines (25 loc) · 604 Bytes
layout api-command
language Java
permalink api/java/error/
command error
io
r
error

Command syntax

{% apibody %} r.error(message) → error {% endapibody %}

Description

Throw a runtime error. If called with no arguments inside the second argument to default, re-throw the current error.

Example: Iron Man can't possibly have lost a battle:

r.table("marvel").get("IronMan").do_(
    ironman -> r.branch(
        ironman.g("victories").lt(ironman.g("battles")),
        r.error("impossible code path"),
        ironman
    )
).run(conn);