[asterisk-commits] mjordan: testsuite/asterisk/trunk r3998 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 8 08:02:35 CDT 2013


Author: mjordan
Date: Thu Aug  8 08:02:33 2013
New Revision: 3998

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3998
Log:
Don't raise an exception if csvreader can't be created

If csvreader can't be created, the AsteriskCSV class will already handle it
gracefully. Raising an exception creates a situation in which a twisted errback
may have to handle the error while the reactor is shutting down. While an
errback could be created to handle this, the complexity with the Asterisk
shutdown sequence tends to result in situations where it is harder to handle
the exception (and thus prevent the entire test from hanging) than it is
to simply not have an exception be raised and let the CSV processing fail.

Modified:
    asterisk/trunk/lib/python/asterisk/astcsv.py

Modified: asterisk/trunk/lib/python/asterisk/astcsv.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/astcsv.py?view=diff&rev=3998&r1=3997&r2=3998
==============================================================================
--- asterisk/trunk/lib/python/asterisk/astcsv.py (original)
+++ asterisk/trunk/lib/python/asterisk/astcsv.py Thu Aug  8 08:02:33 2013
@@ -95,11 +95,9 @@
         try:
             csvreader = csv.DictReader(open(fn, "r"), fields, ",")
         except IOError as (errno, strerror):
-            logger.debug("IOError %d[%s] while opening file '%s'" % (errno, strerror, fn))
-            raise
+            logger.error("IOError %d[%s] while opening file '%s'" % (errno, strerror, fn))
         except:
-            logger.debug("Unexpected error: %s" % (sys.exc_info()[0]))
-            raise
+            logger.error("Unexpected error: %s" % (sys.exc_info()[0]))
 
         if not csvreader:
             logger.error("Unable to open file '%s'" % (fn))




More information about the asterisk-commits mailing list