Esempio n. 1
0
 def fire_event(self, event):
     for listener in self.event_listeners:
         try:
             listener(event)
         except:
             common.record_exception()
             pass
Esempio n. 2
0
def jsonify(f):
    def g(self, *a, **kw):
        t_start = time.time()
        web.ctx.setdefault("headers", [])
                
        if not web.ctx.get('infobase_localmode'):
            cookies = web.cookies(infobase_auth_token=None)
            web.ctx.infobase_auth_token = cookies.infobase_auth_token
                        
        try:
            d = f(self, *a, **kw)
        except common.InfobaseException, e:
            if web.ctx.get('infobase_localmode'):
                raise
            
            process_exception(e)
        except Exception, e:
            logger.error("Error in processing request %s %s", web.ctx.get("method", "-"), web.ctx.get("path","-"), exc_info=True)

            common.record_exception()
            # call web.internalerror to send email when web.internalerror is set to web.emailerrors
            process_exception(common.InfobaseException(error="internal_error", message=str(e)))
            
            if web.ctx.get('infobase_localmode'):
                raise common.InfobaseException(message=str(e))
            else:
                process_exception(e)
Esempio n. 3
0
def jsonify(f):
    def g(self, *a, **kw):
        t_start = time.time()
        web.ctx.setdefault("headers", [])

        if not web.ctx.get('infobase_localmode'):
            cookies = web.cookies(infobase_auth_token=None)
            web.ctx.infobase_auth_token = cookies.infobase_auth_token

        try:
            d = f(self, *a, **kw)
        except common.InfobaseException, e:
            if web.ctx.get('infobase_localmode'):
                raise

            process_exception(e)
        except Exception, e:
            logger.error("Error in processing request %s %s",
                         web.ctx.get("method", "-"),
                         web.ctx.get("path", "-"),
                         exc_info=True)

            common.record_exception()
            # call web.internalerror to send email when web.internalerror is set to web.emailerrors
            process_exception(
                common.InfobaseException(error="internal_error",
                                         message=str(e)))

            if web.ctx.get('infobase_localmode'):
                raise common.InfobaseException(message=str(e))
            else:
                process_exception(e)
Esempio n. 4
0
 def fire_event(self, event):
     for listener in self.event_listeners:
         try:
             listener(event)
         except:
             common.record_exception()
             pass
Esempio n. 5
0
def jsonify(f):
    def g(self, *a, **kw):
        if not web.ctx.get('infobase_localmode'):
            cookies = web.cookies(infobase_auth_token=None)
            web.ctx.infobase_auth_token = cookies.infobase_auth_token
                
        try:
            d = f(self, *a, **kw)
        except common.InfobaseException, e:
            if web.ctx.get('infobase_localmode'):
                raise
            
            process_exception(e)
        except Exception, e:
            common.record_exception()
            # call web.internalerror to send email when web.internalerror is set to web.emailerrors
            process_exception(common.InfobaseException(error="internal_error", message=str(e)))
            
            if web.ctx.get('infobase_localmode'):
                raise common.InfobaseException(message=str(e))
            else:
                process_exception(e)