當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。