File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/query_farm_airport_test_server Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -736,6 +736,18 @@ def impl_do_action(
736736 if context .caller .token .token in self .contents :
737737 del self .contents [context .caller .token .token ]
738738 return iter ([])
739+ elif action .type == "generate_error" :
740+ error_name = action .body .to_pybytes ().decode ("utf-8" )
741+ known_errors = {
742+ "flight_unavailable" : flight .FlightUnavailableError ,
743+ "flight_server_error" : flight .FlightServerError ,
744+ "flight_unauthenticated" : flight .FlightUnauthenticatedError ,
745+ }
746+ if error_name in known_errors :
747+ raise known_errors [error_name ](f"Testing error: { error_name } " )
748+ else :
749+ context .logger .error ("Unknown error type" , error_name = error_name )
750+ raise flight .FlightServerError (f"Unknown error type: { error_name } " )
739751 elif action .type == "create_database" :
740752 database_name = action .body .to_pybytes ().decode ("utf-8" )
741753 context .logger .debug ("Creating database" , database_name = database_name )
You can’t perform that action at this time.
0 commit comments