genotrance/px

IndexError wproxy.DIRECT

Opened this issue · 0 comments

I got this error this morning:

----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 58976)
Traceback (most recent call last):
  File "socketserver.py", line 692, in process_request_thread
  File "socketserver.py", line 362, in finish_request
  File "socketserver.py", line 761, in __init__
  File "http\server.py", line 436, in handle
  File "PX\Lib\site-packages\px\handler.py", line 128, in handle_one_request
    http.server.BaseHTTPRequestHandler.handle_one_request(self)
  File "http\server.py", line 424, in handle_one_request
  File "PX\Lib\site-packages\px\handler.py", line 230, in do_GET
    self.do_curl()
  File "PX\Lib\site-packages\px\handler.py", line 159, in do_curl
    ipport = self.get_destination()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "PX\Lib\site-packages\px\handler.py", line 257, in get_destination
    if servers[0] == wproxy.DIRECT:
       ~~~~~~~^^^
IndexError: list index out of range
----------------------------------------

The reason is normal: I didn't have any network at the time because my computer wasn't connected to either a cable or the wifi.

It would be nice to dump a nicer error message to say something like "Are you sure you're connected to the network?" instead of a stackdump ;-)