resolveTransactionResult method

FutureOr resolveTransactionResult(
  1. dynamic result,
  2. Transaction transaction,
  3. C? connection
)

Implementation

FutureOr<dynamic> resolveTransactionResult(
    dynamic result, Transaction transaction, C? connection) async {
  // When aborted `_transactionCompleter.complete` will be called
  // with the error (not calling `completeError`), since it's
  // running in another error zone (won't reach `onError`):
  if (result is TransactionAbortedError) {
    if (cancelTransactionResultWithError) {
      await cancelTransaction(
          transaction, connection, result, result.stackTrace);

      if (throwTransactionResultWithError) {
        throw result;
      } else {
        return result;
      }
    } else if (throwTransactionResultWithError) {
      throw result;
    }
  }

  return result;
}