- import sys, traceback\r
- traceback.print_exc(file=sys.stdout)\r
-\r
- response = {\r
- 'success': False,\r
- 'error_message': str(e)\r
- }\r
+ #import sys, traceback\r
+ #traceback.print_exc(file=sys.stdout)\r
+\r
+ if isinstance(e, CommandException):\r
+ response = {\r
+ 'success': False,\r
+ 'error_message': e.message\r
+ }\r
+ else:\r
+ logging.error("%s: %s" % (func.__name__, str(e)))\r
+ response = {\r
+ 'success': False,\r
+ 'error_message': _("We're sorry, but an unknown error ocurred.<br />Please try again in a while.")\r
+ }\r