-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathTransactionException.cs
More file actions
46 lines (41 loc) · 1.3 KB
/
TransactionException.cs
File metadata and controls
46 lines (41 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using Waher.Events;
namespace Waher.Runtime.Transactions
{
/// <summary>
/// Exception object for transaction exceptions.
/// </summary>
public class TransactionException : Exception, IEventObject
{
private readonly ITransaction transaction;
/// <summary>
/// Exception object for transaction exceptions.
/// </summary>
/// <param name="Transaction">Reference to transaction object.</param>
/// <param name="Message">Exception message.</param>
public TransactionException(ITransaction Transaction, string Message)
: base(Message)
{
this.transaction = Transaction;
}
/// <summary>
/// Exception object for transaction exceptions.
/// </summary>
/// <param name="Transaction">Reference to transaction object.</param>
/// <param name="Message">Exception message.</param>
/// <param name="InnerException">Inner exception.</param>
public TransactionException(ITransaction Transaction, string Message, Exception InnerException)
: base(Message, InnerException)
{
this.transaction = Transaction;
}
/// <summary>
/// Reference to transaction object.
/// </summary>
public ITransaction Transaction => this.transaction;
/// <summary>
/// Object identifier related to the object.
/// </summary>
public string Object => this.transaction.Id.ToString();
}
}