Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Looks for and extracts an error message from a web-response received from a Twitter's API call.
Syntax
client server public static str extractErrorMessageFromWebResponse(RetailWebResponse _webResponse)
Run On
Called
Parameters
- _webResponse
Type: RetailWebResponse Class
The RetailWebResponse object to extract the error message from.
Return Value
Type: str
The error message.
Remarks
The following cases are implemented.
1) If the response has HTTP status code 200, it returns an empty string.
2) If the response's content type is JSON: 2.1) If the data could be parsed as JSON and there is a key with name 'error', it returns value of that key.
2.2) Otherwise it returns an empty string.
3) If the response contains 2 occurances of word 'html' (no matter the case), it returns an empty string.
4) Otherwise it returns the content data as is.