CURA-1923: Don't return a complete traceback on HTTPError

As discussed on GitHub we don't need a complete traceback on HTTPError.
However URLError should return a full traceback, like any other
exception that might occur.
This commit is contained in:
Thomas Karl Pietrowski 2016-08-07 08:16:22 +02:00
parent 7c6df5a485
commit 8e92cb4c91

View File

@ -47,7 +47,9 @@ class SliceInfoJob(Job):
f = urllib.request.urlopen(self.url, **kwoptions)
Logger.log("i", "Sent anonymous slice info to %s", self.url)
f.close()
except Exception:
except urllib.error.HTTPError as http_exception:
Logger.log("e", "An exception occurred while trying to send slice information: %s" %(repr(http_exception)))
except Exception: # Includes urllib.error.HTTPError, was discussed to be handled like any other exception
Logger.logException("e", "An exception occurred while trying to send slice information")
## This Extension runs in the background and sends several bits of information to the Ultimaker servers.