@@ -3,6 +3,7 @@ use pyo3::{
33 types:: { PyModule , PyModuleMethods } ,
44 Bound , PyResult , Python ,
55} ;
6+
67// Main exception.
78create_exception ! (
89 psqlpy. exceptions,
@@ -146,108 +147,93 @@ create_exception!(psqlpy.exceptions, SSLError, RustPSQLDriverPyBaseError);
146147pub fn python_exceptions_module ( py : Python < ' _ > , pymod : & Bound < ' _ , PyModule > ) -> PyResult < ( ) > {
147148 pymod. add (
148149 "RustPSQLDriverPyBaseError" ,
149- py. get_type_bound :: < RustPSQLDriverPyBaseError > ( ) ,
150+ py. get_type :: < RustPSQLDriverPyBaseError > ( ) ,
150151 ) ?;
151152
152153 pymod. add (
153154 "BaseConnectionPoolError" ,
154- py. get_type_bound :: < BaseConnectionPoolError > ( ) ,
155+ py. get_type :: < BaseConnectionPoolError > ( ) ,
155156 ) ?;
156157 pymod. add (
157158 "ConnectionPoolBuildError" ,
158- py. get_type_bound :: < ConnectionPoolBuildError > ( ) ,
159+ py. get_type :: < ConnectionPoolBuildError > ( ) ,
159160 ) ?;
160161 pymod. add (
161162 "ConnectionPoolConfigurationError" ,
162- py. get_type_bound :: < ConnectionPoolConfigurationError > ( ) ,
163+ py. get_type :: < ConnectionPoolConfigurationError > ( ) ,
163164 ) ?;
164165 pymod. add (
165166 "ConnectionPoolExecuteError" ,
166- py. get_type_bound :: < ConnectionPoolExecuteError > ( ) ,
167+ py. get_type :: < ConnectionPoolExecuteError > ( ) ,
167168 ) ?;
168169
169- pymod. add (
170- "BaseConnectionError" ,
171- py. get_type_bound :: < BaseConnectionError > ( ) ,
172- ) ?;
170+ pymod. add ( "BaseConnectionError" , py. get_type :: < BaseConnectionError > ( ) ) ?;
173171 pymod. add (
174172 "ConnectionExecuteError" ,
175- py. get_type_bound :: < ConnectionExecuteError > ( ) ,
173+ py. get_type :: < ConnectionExecuteError > ( ) ,
176174 ) ?;
177175 pymod. add (
178176 "ConnectionClosedError" ,
179- py. get_type_bound :: < ConnectionClosedError > ( ) ,
177+ py. get_type :: < ConnectionClosedError > ( ) ,
180178 ) ?;
181179
182180 pymod. add (
183181 "BaseTransactionError" ,
184- py. get_type_bound :: < BaseTransactionError > ( ) ,
182+ py. get_type :: < BaseTransactionError > ( ) ,
185183 ) ?;
186184 pymod. add (
187185 "TransactionBeginError" ,
188- py. get_type_bound :: < TransactionBeginError > ( ) ,
186+ py. get_type :: < TransactionBeginError > ( ) ,
189187 ) ?;
190188 pymod. add (
191189 "TransactionCommitError" ,
192- py. get_type_bound :: < TransactionCommitError > ( ) ,
190+ py. get_type :: < TransactionCommitError > ( ) ,
193191 ) ?;
194192 pymod. add (
195193 "TransactionRollbackError" ,
196- py. get_type_bound :: < TransactionRollbackError > ( ) ,
194+ py. get_type :: < TransactionRollbackError > ( ) ,
197195 ) ?;
198196 pymod. add (
199197 "TransactionSavepointError" ,
200- py. get_type_bound :: < TransactionSavepointError > ( ) ,
198+ py. get_type :: < TransactionSavepointError > ( ) ,
201199 ) ?;
202200 pymod. add (
203201 "TransactionExecuteError" ,
204- py. get_type_bound :: < TransactionExecuteError > ( ) ,
202+ py. get_type :: < TransactionExecuteError > ( ) ,
205203 ) ?;
206204 pymod. add (
207205 "TransactionClosedError" ,
208- py. get_type_bound :: < TransactionClosedError > ( ) ,
206+ py. get_type :: < TransactionClosedError > ( ) ,
209207 ) ?;
210208
211- pymod. add ( "BaseCursorError" , py. get_type_bound :: < BaseCursorError > ( ) ) ?;
212- pymod. add ( "CursorStartError" , py. get_type_bound :: < CursorStartError > ( ) ) ?;
213- pymod. add ( "CursorCloseError" , py. get_type_bound :: < CursorCloseError > ( ) ) ?;
214- pymod. add ( "CursorFetchError" , py. get_type_bound :: < CursorFetchError > ( ) ) ?;
215- pymod. add (
216- "CursorClosedError" ,
217- py. get_type_bound :: < CursorClosedError > ( ) ,
218- ) ?;
209+ pymod. add ( "BaseCursorError" , py. get_type :: < BaseCursorError > ( ) ) ?;
210+ pymod. add ( "CursorStartError" , py. get_type :: < CursorStartError > ( ) ) ?;
211+ pymod. add ( "CursorCloseError" , py. get_type :: < CursorCloseError > ( ) ) ?;
212+ pymod. add ( "CursorFetchError" , py. get_type :: < CursorFetchError > ( ) ) ?;
213+ pymod. add ( "CursorClosedError" , py. get_type :: < CursorClosedError > ( ) ) ?;
219214
220215 pymod. add (
221216 "RustToPyValueMappingError" ,
222- py. get_type_bound :: < RustToPyValueMappingError > ( ) ,
217+ py. get_type :: < RustToPyValueMappingError > ( ) ,
223218 ) ?;
224219 pymod. add (
225220 "PyToRustValueMappingError" ,
226- py. get_type_bound :: < PyToRustValueMappingError > ( ) ,
221+ py. get_type :: < PyToRustValueMappingError > ( ) ,
227222 ) ?;
228223 pymod. add (
229224 "UUIDValueConvertError" ,
230- py. get_type_bound :: < UUIDValueConvertError > ( ) ,
225+ py. get_type :: < UUIDValueConvertError > ( ) ,
231226 ) ?;
232227 pymod. add (
233228 "MacAddrConversionError" ,
234- py. get_type_bound :: < MacAddrConversionError > ( ) ,
235- ) ?;
236- pymod. add (
237- "BaseListenerError" ,
238- py. get_type_bound :: < BaseListenerError > ( ) ,
239- ) ?;
240- pymod. add (
241- "ListenerStartError" ,
242- py. get_type_bound :: < ListenerStartError > ( ) ,
243- ) ?;
244- pymod. add (
245- "ListenerClosedError" ,
246- py. get_type_bound :: < ListenerClosedError > ( ) ,
229+ py. get_type :: < MacAddrConversionError > ( ) ,
247230 ) ?;
231+ pymod. add ( "BaseListenerError" , py. get_type :: < BaseListenerError > ( ) ) ?;
232+ pymod. add ( "ListenerStartError" , py. get_type :: < ListenerStartError > ( ) ) ?;
233+ pymod. add ( "ListenerClosedError" , py. get_type :: < ListenerClosedError > ( ) ) ?;
248234 pymod. add (
249235 "ListenerCallbackError" ,
250- py. get_type_bound :: < ListenerCallbackError > ( ) ,
236+ py. get_type :: < ListenerCallbackError > ( ) ,
251237 ) ?;
252238 Ok ( ( ) )
253239}
0 commit comments