当前位置: 首页>>代码示例>>Python>>正文


Python HTTPException.__init__方法代码示例

本文整理汇总了Python中werkzeug.exceptions.HTTPException.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPException.__init__方法的具体用法?Python HTTPException.__init__怎么用?Python HTTPException.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在werkzeug.exceptions.HTTPException的用法示例。


在下文中一共展示了HTTPException.__init__方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
	def __init__(self, data, description=None):
		"""
		param: data: A dictionary containing the field errors that occured
		param: description: Optional description to send through
		"""
		HTTPException.__init__(self)
		self.data = data
开发者ID:stikks,项目名称:moshalashi,代码行数:9,代码来源:__init__.py

示例2: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
    def __init__(self, description, locator="", code=400):
        self.code = code
        self.description = description
        self.locator = locator
        logging.exception(description)

        HTTPException.__init__(self)
开发者ID:kalxas,项目名称:pywps,代码行数:9,代码来源:exceptions.py

示例3: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
    def __init__(self, description, locator="", code=400):
        self.code = code
        self.description = description
        self.locator = locator
        msg = 'Exception: code: %s, locator: %s, description: %s' % (self.code, self.description, self.locator)
        LOGGER.exception(msg)

        HTTPException.__init__(self)
开发者ID:jan-rudolf,项目名称:pywps,代码行数:10,代码来源:exceptions.py

示例4: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
    def __init__(message=None, data=None, code=400, **kwargs):
        data = data or kwargs
        if instanceof(message, str):
            data, message = message, None
        if message:
            data["message"] = message

        response = jsonify(status="fail", data=data)
        response.status_code = status_code
        HTTPException.__init__(self, message, response)
        self.code = code
开发者ID:gvsurenderreddy,项目名称:ipop-stat,代码行数:13,代码来源:errors.py

示例5: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, message=''):
     # HTTPException has its own custom __init__ method, but we want the
     # usual "First argument is the message" behavior.
     HTTPException.__init__(self)
     self.message = message
开发者ID:shwsun,项目名称:haas,代码行数:7,代码来源:errors.py

示例6: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, code, description):
     HTTPException.__init__(self)
     self.code = code
     self.description = description
开发者ID:01org,项目名称:intel-cmt-cat,代码行数:6,代码来源:rest.py

示例7: init

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
def init(self, description=None, response=None, traceback=None):
    self.traceback = traceback
    HTTPException.__init__(self, description, response)
开发者ID:dmonroy,项目名称:spa,代码行数:5,代码来源:exceptions.py

示例8: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, valid_methods=None, description=None):
     """Takes an optional list of valid http methods
     starting with werkzeug 0.3 the list will be mandatory."""
     HTTPException.__init__(self, description)
     self.valid_methods = valid_methods
开发者ID:couldtt,项目名称:flask-foundation,代码行数:7,代码来源:exceptions.py

示例9: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, location):
     HTTPException.__init__(self)
     self.location = location
开发者ID:diazona,项目名称:Modulo,代码行数:5,代码来源:auth.py

示例10: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, message="Internal Error", response=None):
     if WERKZEUG:
         HTTPException.__init__(self, message, response)
     else:
         self.description = message
         self.response = response
开发者ID:ziirish,项目名称:burp-ui,代码行数:8,代码来源:exceptions.py

示例11: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__ (self, detail='not Found', status=404):
     HTTPException.__init__ (self)
     self.detail = detail
     self.status = status
开发者ID:x3mSpeedy,项目名称:PyRest,代码行数:6,代码来源:api_exception.py

示例12: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, message, code=None):
     HTTPException.__init__(self, message)
     if code is not None:
         self.code = code
开发者ID:coyotevz,项目名称:nbs,代码行数:6,代码来源:rest.py

示例13: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, _server_id, _database_name, _conn_id):
     self.sid = _server_id
     self.db = _database_name
     self.conn_id = _conn_id
     HTTPException.__init__(self)
开发者ID:asheshv,项目名称:pgadmin4,代码行数:7,代码来源:exception.py

示例14: __init__

# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __init__ [as 别名]
 def __init__(self, article_name, original_link, description=None):
     HTTPException.__init__(self, description)
     self.article_name = article_name
     self.original_link = original_link
开发者ID:Alwnikrotikz,项目名称:cdpedia,代码行数:6,代码来源:web_app.py


注:本文中的werkzeug.exceptions.HTTPException.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。