Abort
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: transaction aborted: Reset Transaction
Response error 400. Errors: [](transaction aborted): Reset Transaction, details: []
ERROR com.faunadb.client.errors.BadRequestException: transaction aborted: Reset Transaction
Error: [BadRequest] transaction aborted: Reset Transaction
Error: <class 'faunadb.errors.BadRequest'> ErrorData(code='transaction aborted', description='Reset Transaction', position=[2], failures=None)
{
errors: [
{
position: [
2
],
code: 'transaction aborted',
description: 'Reset Transaction'
}
]
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!