Skip to content

Commit

Permalink
handle InvalidProxyUrl exception
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Sep 29, 2021
1 parent c64a75e commit ac26de6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions planet_explorer/pe_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import sys
import traceback
import urllib3
import requests
from requests import exceptions
import planet

import analytics
Expand Down Expand Up @@ -189,11 +189,11 @@ def plugin_hook(t, value, tb):
trace = "".join(traceback.format_exception(t, value, tb))
if PLUGIN_NAMESPACE in trace.lower():
s = ""
if issubclass(t, requests.exceptions.Timeout):
if issubclass(t, exceptions.Timeout):
s = "Connection to Planet server timed out."
elif issubclass(t, requests.exceptions.ConnectionError):
elif issubclass(t, exceptions.ConnectionError):
s = "Connection error.\n Verify that your computer is correctly connected to the Internet"
elif issubclass(t, requests.exceptions.ProxyError):
elif issubclass(t, (exceptions.ProxyError, exceptions.InvalidProxyUrl)):
s = "ProxyError.\n Verify that your proxy is correctly configured in the QGIS settings"
elif issubclass(t, planet.api.exceptions.ServerError):
s = "Server Error.\n Please, try again later"
Expand Down

0 comments on commit ac26de6

Please sign in to comment.