@@ -71,7 +71,7 @@ impl Transaction {
71
71
} ) ;
72
72
73
73
let Some ( conn) = conn else {
74
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "7" . into ( ) ) ) ;
74
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
75
75
} ;
76
76
let mut write_conn_g = conn. write ( ) . await ;
77
77
write_conn_g
@@ -98,7 +98,7 @@ impl Transaction {
98
98
} ) ;
99
99
100
100
let Some ( conn) = conn else {
101
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "8" . into ( ) ) ) ;
101
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
102
102
} ;
103
103
let mut write_conn_g = conn. write ( ) . await ;
104
104
if is_exception_none {
@@ -121,7 +121,7 @@ impl Transaction {
121
121
pub async fn begin ( & mut self ) -> PSQLPyResult < ( ) > {
122
122
let conn = & self . conn ;
123
123
let Some ( conn) = conn else {
124
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "9" . into ( ) ) ) ;
124
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
125
125
} ;
126
126
let mut write_conn_g = conn. write ( ) . await ;
127
127
write_conn_g
@@ -139,7 +139,7 @@ impl Transaction {
139
139
prepared : Option < bool > ,
140
140
) -> PSQLPyResult < PSQLDriverPyQueryResult > {
141
141
let Some ( conn) = & self . conn else {
142
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "10" . into ( ) ) ) ;
142
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
143
143
} ;
144
144
145
145
let read_conn_g = conn. read ( ) . await ;
@@ -154,7 +154,7 @@ impl Transaction {
154
154
prepared : Option < bool > ,
155
155
) -> PSQLPyResult < PSQLDriverPyQueryResult > {
156
156
let Some ( conn) = & self . conn else {
157
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "11" . into ( ) ) ) ;
157
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
158
158
} ;
159
159
160
160
let read_conn_g = conn. read ( ) . await ;
@@ -169,7 +169,7 @@ impl Transaction {
169
169
prepared : Option < bool > ,
170
170
) -> PSQLPyResult < Py < PyAny > > {
171
171
let Some ( conn) = & self . conn else {
172
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "12" . into ( ) ) ) ;
172
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
173
173
} ;
174
174
175
175
let read_conn_g = conn. read ( ) . await ;
@@ -180,7 +180,7 @@ impl Transaction {
180
180
181
181
pub async fn execute_batch ( & self , querystring : String ) -> PSQLPyResult < ( ) > {
182
182
let Some ( conn) = & self . conn else {
183
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "13" . into ( ) ) ) ;
183
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
184
184
} ;
185
185
186
186
let read_conn_g = conn. read ( ) . await ;
@@ -195,7 +195,7 @@ impl Transaction {
195
195
prepared : Option < bool > ,
196
196
) -> PSQLPyResult < ( ) > {
197
197
let Some ( conn) = & self . conn else {
198
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "14" . into ( ) ) ) ;
198
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
199
199
} ;
200
200
201
201
let read_conn_g = conn. read ( ) . await ;
@@ -212,7 +212,7 @@ impl Transaction {
212
212
prepared : Option < bool > ,
213
213
) -> PSQLPyResult < PSQLDriverSinglePyQueryResult > {
214
214
let Some ( conn) = & self . conn else {
215
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "15" . into ( ) ) ) ;
215
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
216
216
} ;
217
217
218
218
let read_conn_g = conn. read ( ) . await ;
@@ -223,7 +223,7 @@ impl Transaction {
223
223
224
224
pub async fn create_savepoint ( & mut self , savepoint_name : String ) -> PSQLPyResult < ( ) > {
225
225
let Some ( conn) = & self . conn else {
226
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "16" . into ( ) ) ) ;
226
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
227
227
} ;
228
228
229
229
let read_conn_g = conn. read ( ) . await ;
@@ -236,7 +236,7 @@ impl Transaction {
236
236
237
237
pub async fn release_savepoint ( & mut self , savepoint_name : String ) -> PSQLPyResult < ( ) > {
238
238
let Some ( conn) = & self . conn else {
239
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "17" . into ( ) ) ) ;
239
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
240
240
} ;
241
241
242
242
let read_conn_g = conn. read ( ) . await ;
@@ -249,7 +249,7 @@ impl Transaction {
249
249
250
250
pub async fn rollback_savepoint ( & mut self , savepoint_name : String ) -> PSQLPyResult < ( ) > {
251
251
let Some ( conn) = & self . conn else {
252
- return Err ( RustPSQLDriverError :: TransactionClosedError ( "18" . into ( ) ) ) ;
252
+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
253
253
} ;
254
254
255
255
let read_conn_g = conn. read ( ) . await ;
@@ -305,6 +305,6 @@ impl Transaction {
305
305
return future:: try_join_all ( futures) . await ;
306
306
}
307
307
308
- Err ( RustPSQLDriverError :: TransactionClosedError ( "19" . into ( ) ) )
308
+ Err ( RustPSQLDriverError :: TransactionClosedError )
309
309
}
310
310
}
0 commit comments