Hiding exceptions from the user

From: Marti Raudsepp <marti_X_at_X_juffo.org>
Date: Sun, 10 Feb 2008 02:18:02 +0200
To: "cpushare-devel list" <cpushare-devel_X_at_X_cpushare.com>
Hi,

Is there a good reason why the seccomp.py module replaces OSErrors
with an unhelpful "unknown error" message? Seeing "unknown error" in
logfiles isn't very user-friendly, this patch will make it display the
original exception text.

Regards,
Marti

--- cpushare/seccomp.py.orig	2008-02-04 16:17:19.000000000 +0000
+++ cpushare/seccomp.py	2008-02-10 00:16:09.000000000 +0000
_X_at_X_@ -190,7 +190,7 @@
 			dentries = os.listdir(self.cache_dir)
 		except OSError, err:
 			if err[0] != errno.ENOENT:
-				raise Exception('unknown error')
+				raise
 			return
 		if self.hexdigest in dentries:
 			self.text_data = ''
_X_at_X_@ -211,7 +211,7 @@
 			os.mkdir(self.cache_dir)
 		except OSError, err:
 			if err[0] != errno.EEXIST:
-				raise Exception('unknown error')
+				raise
 		self.text_data = data
 		assert len(data) == self.size(), "wrong text_data length"
 		if self.size() <= CACHE_MAX_SIZE:


Received on 2008-02-10 01:18:20

Click here to return to to homepage.

Search CPUShare Devel

Disclaimer: the messages posted here are under the sole responsibility of the poster: cpushare.com is publishing mailing list messages in real time while storing safely all the logs containing the relevant IP addresses, timings and mail hops. If you find anything not appropriate in these messages please send a notification through this form. Thank You.

CPUShare Devel has been converted to html using hypermail 2.2.0.