From 89a3f010b8a66e395d399ec8ddd645d9ec54fcb2 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Thu, 2 Feb 2012 14:48:37 +0900 Subject: [PATCH] client: pass http responce when an error occurs Thus the caller can examine error code instead of abort blindly and can provide more informative message. Signed-off-by: Isaku Yamahata Signed-off-by: FUJITA Tomonori --- ryu/app/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ryu/app/client.py b/ryu/app/client.py index 1371a06e..bc1640f4 100644 --- a/ryu/app/client.py +++ b/ryu/app/client.py @@ -41,8 +41,9 @@ class OFPClientV1_0(object): httplib.NO_CONTENT): return res - raise httplib.HTTPException('code %d reason %s' % - (res.status, res.reason)) + raise httplib.HTTPException( + res, 'code %d reason %s' % (res.status, res.reason), + res.getheaders(), res.read()) def get_networks(self): res = self._do_request('GET', '')