MCPcopy Create free account
hub / github.com/StackStorm/st2 / handle_error

Method handle_error

st2client/st2client/models/core.py:810–823  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

808
809 @staticmethod
810 def handle_error(response):
811 try:
812 content = parse_api_response(response)
813 fault = content.get("faultstring", "") if content else ""
814
815 if fault:
816 response.reason += "\nMESSAGE: %s" % fault
817 except Exception as e:
818 response.reason += (
819 "\nUnable to retrieve detailed message "
820 "from the HTTP response. %s\n" % six.text_type(e)
821 )
822
823 response.raise_for_status()
824
825 @add_auth_token_to_kwargs_from_env
826 def inspect(self, definition, **kwargs):

Callers 1

inspectMethod · 0.95

Calls 3

parse_api_responseFunction · 0.85
getMethod · 0.45
raise_for_statusMethod · 0.45

Tested by

no test coverage detected