vim-http-client icon indicating copy to clipboard operation
vim-http-client copied to clipboard

Enhanced error handling

Open izurietajr opened this issue 5 years ago • 0 comments

This PR shows a user friendly error message when a request has no response

Errors were not handled and when a server was not available the python error message would take the whole window, this fixes the problem and shows details of three types of errors: Timeout, TooManyRedirects and RequestException errors.

When an exception happens, the buffer shows a message detailing the error type and request info:

Request exception
Request data:

Method:   GET
Path:     /api/v1/companies/
Headers:  {'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Token XXXXXXX'}
Body:     None
Response: None

izurietajr avatar Jun 26 '20 03:06 izurietajr