[asterisk-commits] dlee: branch dlee/stasis-http r384282 - /team/dlee/stasis-http/cog/stasis_cog.py

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 28 11:45:35 CDT 2013


Author: dlee
Date: Thu Mar 28 11:45:32 2013
New Revision: 384282

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384282
Log:
Better error handling

Modified:
    team/dlee/stasis-http/cog/stasis_cog.py

Modified: team/dlee/stasis-http/cog/stasis_cog.py
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/cog/stasis_cog.py?view=diff&rev=384282&r1=384281&r2=384282
==============================================================================
--- team/dlee/stasis-http/cog/stasis_cog.py (original)
+++ team/dlee/stasis-http/cog/stasis_cog.py Thu Mar 28 11:45:32 2013
@@ -294,9 +294,13 @@
         assert not self.children, "Should not reload existing resource"
         assert not self.operations, "Should not reload existing resource"
 
-        resource_listing_dir = os.path.dirname(resource_listing_file)
-        with open(resource_listing_file) as fp:
-            resource_listing = json.load(fp)
+        try:
+            resource_listing_dir = os.path.dirname(resource_listing_file)
+            with open(resource_listing_file) as fp:
+                resource_listing = json.load(fp)
+        except:
+            raise ValueError("Error loading %s: %s" %
+                             (resource_listing_file, sys.exc_info()[0]))
 
         self.author = resource_listing.get('_author')
         self.copyright = resource_listing.get('_copyright')




More information about the asterisk-commits mailing list