From ac26de660103b872aa9c1030bf0ba10edc7f95a6 Mon Sep 17 00:00:00 2001 From: volaya Date: Wed, 29 Sep 2021 09:09:01 +0200 Subject: [PATCH] handle InvalidProxyUrl exception --- planet_explorer/pe_plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/planet_explorer/pe_plugin.py b/planet_explorer/pe_plugin.py index 60a0e43..abce4bd 100644 --- a/planet_explorer/pe_plugin.py +++ b/planet_explorer/pe_plugin.py @@ -29,7 +29,7 @@ import sys import traceback import urllib3 -import requests +from requests import exceptions import planet import analytics @@ -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"