Yelp / bravado

Bravado is a python client library for Swagger 2.0 services
Other
605 stars 117 forks source link

About the problem of non-200 status code processing #487

Closed luoyq-Rockey closed 1 year ago

luoyq-Rockey commented 1 year ago

When the current status code is not 200, HTTPError error will be raised directly. At present, I can only try and expect to get the results of other status codes in this case. Can I control whether I need to judge the status code through configuration to meet my goal of returning the status code 400?

luoyq-Rockey commented 1 year ago

try: response = client.zeppelin.ZeppelinCreate(data=body).response() print(response.result) print(response.incoming_response.status_code) except HTTPError as e: print(e.status_code) # Get the status code I want here