summaryrefslogtreecommitdiff
path: root/bin/wizard/__init__.py
diff options
context:
space:
mode:
authorced <>2007-09-05 14:02:26 +0000
committerced <>2007-09-05 14:02:26 +0000
commitc844422d201d68f70507c48b2fad98aa51aee514 (patch)
treeedba91e0cf330288e75c376db7c3cdfbdb979664 /bin/wizard/__init__.py
parenta66d67987e588a579dfbc8d37b0c298efa99c444 (diff)
Improve exception: don't log exception_{osv, orm, wizard}
bzr revid: ced-6bdaf4ebdab2dcded046448506f94daa0edc4c70
Diffstat (limited to 'bin/wizard/__init__.py')
-rw-r--r--bin/wizard/__init__.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/bin/wizard/__init__.py b/bin/wizard/__init__.py
index c2343cc9eff..093e2ce7fa4 100644
--- a/bin/wizard/__init__.py
+++ b/bin/wizard/__init__.py
@@ -36,11 +36,14 @@ import pooler
from osv.osv import except_osv
from osv.orm import except_orm
+from netsvc import Logger, LOG_ERROR
+import sys
class except_wizard(Exception):
def __init__(self, name, value):
self.name = name
self.value = value
+ self.args = (name, value)
class interface(netsvc.Service):
states = {}
@@ -82,9 +85,6 @@ class interface(netsvc.Service):
lang = context.get('lang', False)
if result_def['type'] == 'action':
res['action'] = result_def['action'](self, cr, uid, data, context)
- elif result_def['type'] == 'choice':
- next_state = result_def['next_state'](self, cr, uid, data, context)
- return self.execute_cr(cr, uid, data, next_state, context)
elif result_def['type'] == 'form':
fields = copy.copy(result_def['fields'])
arch = copy.copy(result_def['arch'])
@@ -146,7 +146,17 @@ class interface(netsvc.Service):
or isinstance(e, except_orm):
self.abortResponse(2, e.name, 'warning', e.value)
else:
+ import traceback
+ tb_s = reduce(lambda x, y: x+y, traceback.format_exception(
+ sys.exc_type, sys.exc_value, sys.exc_traceback))
+ logger = Logger()
+ logger.notifyChannel("web-services", LOG_ERROR,
+ 'Exception in call: ' + tb_s)
raise
+
+ if result_def['type'] == 'choice':
+ next_state = result_def['next_state'](self, cr, uid, data, context)
+ return self.execute_cr(cr, uid, data, next_state, context)
return res
def execute(self, db, uid, data, state='init', context=None):