From 8e92cb4c91bff762396d6603013c11a0f092894e Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Sun, 7 Aug 2016 08:16:22 +0200 Subject: [PATCH] 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. --- plugins/SliceInfoPlugin/SliceInfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 5630f76805..57a1db7244 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -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.