-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabaseTransactionErrorPostgres.swift
More file actions
46 lines (41 loc) · 1.28 KB
/
DatabaseTransactionErrorPostgres.swift
File metadata and controls
46 lines (41 loc) · 1.28 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
//
// DatabaseTransactionErrorPostgres.swift
// feather-database-postgres
//
// Created by Tibor Bödecs on 2026. 02. 02..
//
import FeatherDatabase
import PostgresNIO
public struct DatabaseTransactionErrorPostgres: DatabaseTransactionError {
public let file: String
public let line: Int
public let beginError: (any Error)?
public let closureError: (any Error)?
public let commitError: (any Error)?
public let rollbackError: (any Error)?
init(
file: String = #fileID,
line: Int = #line,
beginError: (any Error)? = nil,
closureError: (any Error)? = nil,
commitError: (any Error)? = nil,
rollbackError: (any Error)? = nil
) {
self.file = file
self.line = line
self.beginError = beginError
self.closureError = closureError
self.commitError = commitError
self.rollbackError = rollbackError
}
init(
underlyingError: PostgresTransactionError
) {
self.file = underlyingError.file
self.line = underlyingError.line
self.beginError = underlyingError.beginError
self.closureError = underlyingError.closureError
self.commitError = underlyingError.commitError
self.rollbackError = underlyingError.rollbackError
}
}