Abort
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
Abort( message )
abort( message )
Abort( message )
Abort( message )
Abort( message )
Abort( message )
Description
The Abort
function terminates the current transaction and
augments the returned error with the associated message. Any
modifications to data or schema in the aborted transaction are ignored,
even if this modification took place before the abort function was
executed.
Examples
The following query is a single transaction with three statements. The
first statement creates a collection, the second statement adds an
document to the collection, and the third statement aborts the
transaction. Due to the transaction being terminated by the Abort
call, neither the creation of the collection nor the addition of the
document is present in the database.
Error: [BadRequest] transaction aborted: Reset Transaction
Error: <class 'faunadb.errors.BadRequest'> ErrorData(code='transaction aborted', description='Reset Transaction', position=[2], failures=None)
Response error 400. Errors: [](transaction aborted): Reset Transaction, details: []
ERROR: transaction aborted: Reset Transaction
ERROR com.faunadb.client.errors.BadRequestException: transaction aborted: Reset Transaction
{
errors: [
{
position: [
2
],
code: 'transaction aborted',
description: 'Reset Transaction'
}
]
}