@@ -37,7 +37,7 @@ async def sign_in() -> Response:
3737 except AdminApiException as e :
3838 http_exception = HTTPException (e .detail )
3939 http_exception .code = e .status_code
40- raise http_exception
40+ raise http_exception from e
4141
4242
4343@api_router .route ("/sign-out" , methods = ["POST" ])
@@ -57,7 +57,7 @@ async def sign_out() -> Response:
5757 except AdminApiException as e :
5858 http_exception = HTTPException (e .detail )
5959 http_exception .code = e .status_code
60- raise http_exception
60+ raise http_exception from e
6161
6262
6363@api_router .route ("/me" , methods = ["GET" ])
@@ -79,7 +79,7 @@ async def me() -> dict:
7979 except AdminApiException as e :
8080 http_exception = HTTPException (e .detail )
8181 http_exception .code = e .status_code
82- raise http_exception
82+ raise http_exception from e
8383
8484
8585@api_router .route ("/dashboard-widget/<string:model>" , methods = ["GET" ])
@@ -109,7 +109,7 @@ async def dashboard_widget(model: str) -> dict:
109109 except AdminApiException as e :
110110 http_exception = HTTPException (e .detail )
111111 http_exception .code = e .status_code
112- raise http_exception
112+ raise http_exception from e
113113
114114
115115@api_router .route ("/list/<string:model>" , methods = ["GET" ])
@@ -143,14 +143,14 @@ async def list_objs(model: str) -> dict:
143143 "total" : total ,
144144 "results" : objs ,
145145 }
146- except ValueError :
146+ except ValueError as e :
147147 http_exception = HTTPException ("Invalid format of get parameters" )
148148 http_exception .code = 422
149- raise http_exception
149+ raise http_exception from e
150150 except AdminApiException as e :
151151 http_exception = HTTPException (e .detail )
152152 http_exception .code = e .status_code
153- raise http_exception
153+ raise http_exception from e
154154
155155
156156@api_router .route ("/retrieve/<string:model>/<string:id>" , methods = ["GET" ])
@@ -174,7 +174,7 @@ async def get(model: str, id: UUID | int) -> dict:
174174 except AdminApiException as e :
175175 http_exception = HTTPException (e .detail )
176176 http_exception .code = e .status_code
177- raise http_exception
177+ raise http_exception from e
178178
179179
180180@api_router .route ("/add/<string:model>" , methods = ["POST" ])
@@ -195,7 +195,7 @@ async def add(model: str) -> dict:
195195 except AdminApiException as e :
196196 http_exception = HTTPException (e .detail )
197197 http_exception .code = e .status_code
198- raise http_exception
198+ raise http_exception from e
199199
200200
201201@api_router .route ("/change-password/<string:id>" , methods = ["PATCH" ]) # type: ignore [type-var]
@@ -221,7 +221,7 @@ async def change_password(id: UUID | int) -> UUID | int:
221221 except AdminApiException as e :
222222 http_exception = HTTPException (e .detail )
223223 http_exception .code = e .status_code
224- raise http_exception
224+ raise http_exception from e
225225
226226
227227@api_router .route ("/change/<string:model>/<string:id>" , methods = ["PATCH" ])
@@ -248,7 +248,7 @@ async def change(model: str, id: UUID | int) -> dict:
248248 except AdminApiException as e :
249249 http_exception = HTTPException (e .detail )
250250 http_exception .code = e .status_code
251- raise http_exception
251+ raise http_exception from e
252252
253253
254254@api_router .route ("/export/<string:model>" , methods = ["POST" ])
@@ -282,7 +282,7 @@ async def export(model: str) -> Response:
282282 except AdminApiException as e :
283283 http_exception = HTTPException (e .detail )
284284 http_exception .code = e .status_code
285- raise http_exception
285+ raise http_exception from e
286286
287287
288288@api_router .route ("/delete/<string:model>/<string:id>" , methods = ["DELETE" ]) # type: ignore [type-var]
@@ -309,7 +309,7 @@ async def delete(
309309 except AdminApiException as e :
310310 http_exception = HTTPException (e .detail )
311311 http_exception .code = e .status_code
312- raise http_exception
312+ raise http_exception from e
313313
314314
315315@api_router .route ("/action/<string:model>/<string:action>" , methods = ["POST" ])
@@ -337,7 +337,7 @@ async def action(
337337 except AdminApiException as e :
338338 http_exception = HTTPException (e .detail )
339339 http_exception .code = e .status_code
340- raise http_exception
340+ raise http_exception from e
341341
342342
343343@api_router .route ("/configuration" , methods = ["GET" ])
0 commit comments