Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 601 Bytes

File metadata and controls

28 lines (20 loc) · 601 Bytes
layout api-command
language Python
permalink api/python/error/
command 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(
    lambda ironman: r.branch(ironman['victories'] < ironman['battles'],
                             r.error('impossible code path'),
                             ironman)
).run(conn)