You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by pq...@apache.org on 2010/08/13 02:09:38 UTC

svn commit: r985048 - /incubator/libcloud/trunk/libcloud/types.py

Author: pquerna
Date: Fri Aug 13 00:09:37 2010
New Revision: 985048

URL: http://svn.apache.org/viewvc?rev=985048&view=rev
Log:
Optionally include the Body of the reaponse in the MalformedResponseException error

Modified:
    incubator/libcloud/trunk/libcloud/types.py

Modified: incubator/libcloud/trunk/libcloud/types.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/types.py?rev=985048&r1=985047&r2=985048&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/types.py (original)
+++ incubator/libcloud/trunk/libcloud/types.py Fri Aug 13 00:09:37 2010
@@ -87,7 +87,12 @@ class MalformedResponseException(LibClou
     """Exception for the cases when a provider returns a malformed
     response, e.g. you request JSON and provider returns 
     '<h3>something</h3>' due to some error on their side."""
-    pass
+    def __init__(self, value, body=None, driver=None):
+      self.value = value
+      self.driver = driver
+      self.body = body
+    def __str__(self):
+        return "<MalformedResponseException in "+ driver +" "+ repr(self.value) +">: "+ repr(self.body)
 
 class InvalidCredsException(LibCloudException):
     """Exception used when invalid credentials are used on a provider."""