Stoobly / stoobly-agent

Record, mock, and test HTTP/HTTPS requests. CLI agent for Stoobly.
Other
6 stars 0 forks source link

No feedback on replayed requests that fail #86

Closed stoobmmelier closed 1 year ago

stoobmmelier commented 1 year ago

Currently there is no feedback on if a replayed request failed or not such as reaching a URL that's inaccessible. The UI shows nothing in the replay history too

User has to go to the agent logs and see that the request failed after max retries. We should show feedback such as why the request failed in a easy to read way and add it to the replay history.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 747, in __init__
    self.handle()
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 433, in handle
    self.handle_one_request()
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 421, in handle_one_request
    method()
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/api/application_http_request_handler.py", line 48, in do_GET
    if not self.route('GET'):
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/api/application_http_request_handler.py", line 126, in route
    handler(self)
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/api/requests_controller.py", line 209, in replay
    self.__replay(context, replay_context)
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/api/requests_controller.py", line 266, in __replay
    self.__send(context, replay_context, callback)
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/api/requests_controller.py", line 270, in __send
    res = replay(replay_context, { 'mode': mode.REPLAY })
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/proxy/replay/replay_request_service.py", line 105, in replay
    res = simulate_intercept(request, **request_config)
  File "/Users/user/Library/Python/3.10/lib/python/site-packages/stoobly_agent/app/proxy/simulate_intercept_service.py", line 21, in simulate_intercept
    res = session.send(prepared_request, **config)
  File "/opt/homebrew/lib/python3.10/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='some-host.com', port=443): Max retries exceeded with url: /users (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x104cd42e0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
Jvlythical commented 1 year ago

Fixed by internal commit: https://github.com/Stoobly/stoobly-dashboard/commit/21e8eb25339bb1c90a52ed8a905560dd3bebab61