Пример #1
0
 def internalerror(self):
     """Message for `500 internal error`."""
     
     if web.config.get('debug'):
         return debugerror.debugerror()
     else:
         return "internal server error"
Пример #2
0
 def internalerror(self):
     """Message for `500 internal error`."""
     
     if web.config.get('debug'):
         return debugerror.debugerror()
     else:
         return "internal server error"
Пример #3
0
 def internalerror(self):
     parent = self.get_parent_app()
     if parent:
         return parent.internalerror()
     elif web.config.get('debug'):
         import debugerror
         return debugerror.debugerror()
     else:
         return web._InteralError()
Пример #4
0
 def internalerror(self):
     """Returns HTTPError with '500 internal error' message"""
     parent = self.get_parent_app()
     if parent:
         return parent.internalerror()
     elif web.config.get('debug'):
         import debugerror
         return debugerror.debugerror()
     else:
         return web._InternalError()
Пример #5
0
 def internalerror(self):
     """Returns HTTPError with '500 internal error' message"""
     parent = self.get_parent_app()
     if parent:
         return parent.internalerror()
     elif web.config.get('debug'):
         import debugerror
         return debugerror.debugerror()
     else:
         return web._InternalError()
Пример #6
0
 def internalerror(self):
     # ----------if any exception happens in code and not catched/handled,
     #-----------we return an 500 error: unhandled internal error---------
     """Returns HTTPError with '500 internal error' message"""
     parent = self.get_parent_app()
     if parent:
         return parent.internalerror()
     elif web.config.get('debug'):
         import debugerror
         return debugerror.debugerror()
     else:
         return web._InternalError()
Пример #7
0
def InternalError(message=None):
    """Returns HTTPError with '500 internal error' error from the active application.
    """
    if message:
        return _InternalError(message)
    elif ctx.get('app_stack'):
        return ctx.app_stack[-1].internalerror()
    elif config.get('debug'):
        import debugerror
        return debugerror.debugerror()
    else:
        return _InternalError()
Пример #8
0
        cls_ = handlers.get(urlbits[0])
        
        if not cls_:
            raise RestyError('module <%s> not exist'%urlbits[0])

        hdl = cls_(ctx, query, urlbits, web.config.get('resty_db'))

        return hdl.run()

    except RestyError, ex:
        return { 'success': False, 'error': ex.msg }
    
    except:
        if debug:
            import debugerror
            raise debugerror.debugerror()
        else:
            return { 'success': False, 'error': 'unknow' }


handlers = {}

class Handler_model(object):

    def __init__(self, ctx, query, urlbits, db=None):
        utils.autoassign(self, locals())
        self.model = urlbits[1]
        self.op_mode = int(query.pop('_op', ['0'])[0])
        
        if ctx.method in ('POST', 'PUT'):
            if '_data' in query:
Пример #9
0
 def get_message(self):
     if config.get('debug'):
         import debugerror
         return debugerror.debugerror()
     else:
         return self.message