From: Thierry Parmentelat Date: Wed, 3 Jul 2013 08:15:56 +0000 (+0200) Subject: cosmetic & debug X-Git-Tag: myslice-0.2-1~113^2 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=2f1347ac1031c64b93c0b397add527ef33948974 cosmetic & debug --- diff --git a/manifold/manifoldapi.py b/manifold/manifoldapi.py index 14eef3be..cc38ba74 100644 --- a/manifold/manifoldapi.py +++ b/manifold/manifoldapi.py @@ -40,7 +40,7 @@ class ManifoldAPI: def __getattr__(self, methodName): def func(*args, **kwds): try: - if debug: print "====> ManifoldAPI.%s"%methodName,"args",args,"kwds",kwds + if debug: print "====> ManifoldAPI.%s"%methodName,"auth",self.auth,"args",args,"kwds",kwds result=getattr(self.server, methodName)(self.auth, *args, **kwds) if debug: print '<==== backend call %s(*%s,**%s) returned'%(methodName,args,kwds), @@ -53,7 +53,7 @@ class ManifoldAPI: # minimal treatment is required, but we do want to turn this into a # class instance if result['code'] != 2: # in the manifold world, this can be either - # 0 (ok) 1 (partial result) or 2 which means error + # 0 (ok) 1 (partial result) or 2 (which means error) if debug: print "OK (new API)" return ManifoldResult(code=result['code'], value=result['value']) else: @@ -73,6 +73,8 @@ class ManifoldAPI: if debug: print "KO (old API - 8002) - raising ManifoldException" reason="most likely your session has expired" reason += " (the manifold API has no unambiguous error reporting mechanism yet)" + import traceback + traceback.print_exc() raise ManifoldException ( ManifoldResult (code=ManifoldCode.SESSION_EXPIRED, output=reason)) else: if debug: print "KO (old API - other) - raising ManifoldException" diff --git a/trash/sliceview.py b/trash/sliceview.py index edf871c7..eea4e22e 100644 --- a/trash/sliceview.py +++ b/trash/sliceview.py @@ -48,6 +48,8 @@ def slice_view (request, slicename=tmp_default_slice): except Exception, e: # xxx we need to sugarcoat this error message in some error template... print "Unexpected exception",e + import traceback + traceback.print_exc() # return ... def _slice_view (request, slicename):