Skip to content

Commit

Permalink
Add transaction:Error type
Browse files Browse the repository at this point in the history
Part of #267.
  • Loading branch information
jclark committed Dec 17, 2020
1 parent deeb0fb commit 3a61817
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lang/lib/transaction.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
// specific language governing permissions and limitations
// under the License.


# Type of error returned by commit action.
type Error distinct error;

# Information about a transaction that does not change
# after the transaction is started.
type Info readonly & record {|
# Unique identifier for the transaction branch
byte[] xid;
// non-zero means this transaction was a retry of
// a previous one
# The number of previous attempts in a sequence of retries
int retryNumber;
# Information about the previous attempt in a sequence of retries.
Expand Down
7 changes: 4 additions & 3 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -8736,7 +8736,7 @@ <h5>Commit operation</h5>
</p>
<p>
If the transaction manager decided to rollback, then the Commit operation
returns the error value for the cause of the rollback. Otherwise, it returns
returns the error value for the reason for the rollback. Otherwise, it returns
nil.
</p>

Expand Down Expand Up @@ -8845,8 +8845,9 @@ <h4>Commit action</h4>
<p>
Evaluating the <code>commit-action</code> performs the transaction manager
Commit() operation; the result of this operation is the result of the
<code>commit-action</code>. Note that the commit action does not alter the flow
of control.
<code>commit-action</code>. The type of the result is
<code>transaction:Error?</code>. Note that the commit action does not alter the
flow of control.
</p>

</section>
Expand Down

0 comments on commit 3a61817

Please sign in to comment.