File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,19 @@ Error handling
4545--------------
4646
4747PyOData returns *HttpError * when the response code does not match the expected
48- code. Basically the exception is raised for all status codes >= 400.
48+ code. Basically the exception is raised for all status codes >= 400 and its
49+ instances have the property response which holds return value of the library
50+ making HTTP requests.
51+
52+ For example, the following code show how to print out error details if
53+ Python Requests is used as the HTTP communication library.
54+
55+ .. code-block :: python
56+
57+ try :
58+ new_data = create_request.execute()
59+ except pyodata.exceptions.HttpError as ex:
60+ print (ex.response.text)
4961
5062 In the case you know the implementation of back-end part and you want to show
5163accurate errors reported by your service, you can replace *HttpError * by your
You can’t perform that action at this time.
0 commit comments