以下是request.exceptions下的各種異常錯誤:
RequestException: HTTPError(RequestException) UnrewindableBodyError(RequestException) RetryError(RequestException) ConnectionError(RequestException) ProxyError(ConnectionError) SSLError(ConnectionError) ConnectTimeout(ConnectionError, Timeout) Timeout(RequestException) ReadTimeout URLRequired(RequestException) TooManyRedirects(RequestException) MissingSchema(RequestException, ValueError) InvalidSchema(RequestException,ValueError) InvalidURL(RequestException,ValueError) InvalidHeader(RequestException,ValueError) ChunkedEncodingError(RequestException) StreamConsumedError(RequestException,TypeError) ContentDecodingError(RequestException,BaseHTTPError)
在實際應用的過程中,我們可以把請求放在try下,把可能發生的異常用except獲取
