@@ -71,7 +71,7 @@ impl Transaction {
7171 } ) ;
7272
7373 let Some ( conn) = conn else {
74- return Err ( RustPSQLDriverError :: TransactionClosedError ( "7" . into ( ) ) ) ;
74+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
7575 } ;
7676 let mut write_conn_g = conn. write ( ) . await ;
7777 write_conn_g
@@ -98,7 +98,7 @@ impl Transaction {
9898 } ) ;
9999
100100 let Some ( conn) = conn else {
101- return Err ( RustPSQLDriverError :: TransactionClosedError ( "8" . into ( ) ) ) ;
101+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
102102 } ;
103103 let mut write_conn_g = conn. write ( ) . await ;
104104 if is_exception_none {
@@ -121,7 +121,7 @@ impl Transaction {
121121 pub async fn begin ( & mut self ) -> PSQLPyResult < ( ) > {
122122 let conn = & self . conn ;
123123 let Some ( conn) = conn else {
124- return Err ( RustPSQLDriverError :: TransactionClosedError ( "9" . into ( ) ) ) ;
124+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
125125 } ;
126126 let mut write_conn_g = conn. write ( ) . await ;
127127 write_conn_g
@@ -139,7 +139,7 @@ impl Transaction {
139139 prepared : Option < bool > ,
140140 ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
141141 let Some ( conn) = & self . conn else {
142- return Err ( RustPSQLDriverError :: TransactionClosedError ( "10" . into ( ) ) ) ;
142+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
143143 } ;
144144
145145 let read_conn_g = conn. read ( ) . await ;
@@ -154,7 +154,7 @@ impl Transaction {
154154 prepared : Option < bool > ,
155155 ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
156156 let Some ( conn) = & self . conn else {
157- return Err ( RustPSQLDriverError :: TransactionClosedError ( "11" . into ( ) ) ) ;
157+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
158158 } ;
159159
160160 let read_conn_g = conn. read ( ) . await ;
@@ -169,7 +169,7 @@ impl Transaction {
169169 prepared : Option < bool > ,
170170 ) -> PSQLPyResult < Py < PyAny > > {
171171 let Some ( conn) = & self . conn else {
172- return Err ( RustPSQLDriverError :: TransactionClosedError ( "12" . into ( ) ) ) ;
172+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
173173 } ;
174174
175175 let read_conn_g = conn. read ( ) . await ;
@@ -180,7 +180,7 @@ impl Transaction {
180180
181181 pub async fn execute_batch ( & self , querystring : String ) -> PSQLPyResult < ( ) > {
182182 let Some ( conn) = & self . conn else {
183- return Err ( RustPSQLDriverError :: TransactionClosedError ( "13" . into ( ) ) ) ;
183+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
184184 } ;
185185
186186 let read_conn_g = conn. read ( ) . await ;
@@ -195,7 +195,7 @@ impl Transaction {
195195 prepared : Option < bool > ,
196196 ) -> PSQLPyResult < ( ) > {
197197 let Some ( conn) = & self . conn else {
198- return Err ( RustPSQLDriverError :: TransactionClosedError ( "14" . into ( ) ) ) ;
198+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
199199 } ;
200200
201201 let read_conn_g = conn. read ( ) . await ;
@@ -212,7 +212,7 @@ impl Transaction {
212212 prepared : Option < bool > ,
213213 ) -> PSQLPyResult < PSQLDriverSinglePyQueryResult > {
214214 let Some ( conn) = & self . conn else {
215- return Err ( RustPSQLDriverError :: TransactionClosedError ( "15" . into ( ) ) ) ;
215+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
216216 } ;
217217
218218 let read_conn_g = conn. read ( ) . await ;
@@ -223,7 +223,7 @@ impl Transaction {
223223
224224 pub async fn create_savepoint ( & mut self , savepoint_name : String ) -> PSQLPyResult < ( ) > {
225225 let Some ( conn) = & self . conn else {
226- return Err ( RustPSQLDriverError :: TransactionClosedError ( "16" . into ( ) ) ) ;
226+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
227227 } ;
228228
229229 let read_conn_g = conn. read ( ) . await ;
@@ -236,7 +236,7 @@ impl Transaction {
236236
237237 pub async fn release_savepoint ( & mut self , savepoint_name : String ) -> PSQLPyResult < ( ) > {
238238 let Some ( conn) = & self . conn else {
239- return Err ( RustPSQLDriverError :: TransactionClosedError ( "17" . into ( ) ) ) ;
239+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
240240 } ;
241241
242242 let read_conn_g = conn. read ( ) . await ;
@@ -249,7 +249,7 @@ impl Transaction {
249249
250250 pub async fn rollback_savepoint ( & mut self , savepoint_name : String ) -> PSQLPyResult < ( ) > {
251251 let Some ( conn) = & self . conn else {
252- return Err ( RustPSQLDriverError :: TransactionClosedError ( "18" . into ( ) ) ) ;
252+ return Err ( RustPSQLDriverError :: TransactionClosedError ) ;
253253 } ;
254254
255255 let read_conn_g = conn. read ( ) . await ;
@@ -305,6 +305,6 @@ impl Transaction {
305305 return future:: try_join_all ( futures) . await ;
306306 }
307307
308- Err ( RustPSQLDriverError :: TransactionClosedError ( "19" . into ( ) ) )
308+ Err ( RustPSQLDriverError :: TransactionClosedError )
309309 }
310310}
0 commit comments