Ejemplo n.º 1
0
 def get_body(environ=None):
     res = {"code": exception.code, "name": escape(exception.name)}
     description = exception.get_description(environ)
     if config.get_misc("base_rest", "dev_mode"):
         # return exception info only if base_rest is in dev_mode
         res.update({"traceback": exception.traceback, "description": description})
     elif include_description:
         res["description"] = description
     return JSONEncoder().encode(res)
Ejemplo n.º 2
0
 def get_body(environ=None):
     res = {
         'code': exception.code,
         'name': escape(exception.name),
     }
     description = exception.get_description(environ)
     if config.get_misc('base_rest', 'dev_mode'):
         # return exception info only if base_rest is in dev_mode
         res.update({
             'traceback': exception.traceback,
             'description': description
         })
     elif include_description:
         res['description'] = description
     return JSONEncoder().encode(res)