-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLiteTransactionError.swift
More file actions
64 lines (60 loc) · 2.14 KB
/
SQLiteTransactionError.swift
File metadata and controls
64 lines (60 loc) · 2.14 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// SQLiteTransactionError.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 02. 03..
//
/// Transaction error details for SQLite operations.
///
/// Use this to capture errors from transaction phases.
public struct SQLiteTransactionError: Error {
/// The source file where the error was created.
///
/// This is captured with `#fileID` by default.
public let file: String
/// The source line where the error was created.
///
/// This is captured with `#line` by default.
public let line: Int
/// The error thrown while beginning the transaction.
///
/// Set when the `BEGIN` step fails.
public internal(set) var beginError: Error?
/// The error thrown inside the transaction closure.
///
/// Set when the closure fails before commit.
public internal(set) var closureError: Error?
/// The error thrown while committing the transaction.
///
/// Set when the `COMMIT` step fails.
public internal(set) var commitError: Error?
/// The error thrown while rolling back the transaction.
///
/// Set when the `ROLLBACK` step fails.
public internal(set) var rollbackError: Error?
/// Create a SQLite transaction error payload.
///
/// Use this to record the errors that occurred during transaction handling.
/// - Parameters:
/// - file: The source file identifier.
/// - line: The source line number.
/// - beginError: The error thrown while beginning the transaction.
/// - closureError: The error thrown inside the transaction closure.
/// - commitError: The error thrown while committing the transaction.
/// - rollbackError: The error thrown while rolling back the transaction.
init(
file: String = #fileID,
line: Int = #line,
beginError: Error? = nil,
closureError: Error? = nil,
commitError: Error? = nil,
rollbackError: Error? = nil
) {
self.file = file
self.line = line
self.beginError = beginError
self.closureError = closureError
self.commitError = commitError
self.rollbackError = rollbackError
}
}