From d29d1a0050590ba94c9da9d2c380345d865a0ab4 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 23 May 2010 22:26:09 +0000 Subject: [PATCH] added some debugging / sanity checks to python gateway response handler git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1956 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/osrf/gateway.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/osrf/gateway.py b/src/python/osrf/gateway.py index a71d02d..eda1139 100644 --- a/src/python/osrf/gateway.py +++ b/src/python/osrf/gateway.py @@ -69,14 +69,15 @@ class JSONGatewayRequest(GatewayRequest): obj = to_object(data) if obj['status'] != 200: - sys.stderr.write('JSON gateway returned status %d:\n%s\n' % (obj['status'], s)) + sys.stderr.write('JSON gateway returned status %d:\n' % (obj['status'])) return None # the gateway wraps responses in an array to handle streaming data # if there is only one item in the array, it (probably) wasn't a streaming request p = obj['payload'] if len(p) > 1: return p - return p[0] + if len(p): return p[0] + return None def encodeParam(self, param): return osrf.json.to_json(param) -- 2.11.0