12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- # -*- coding: utf-8 -*-
- """
- hyper/common/exceptions
- ~~~~~~~~~~~~~~~~~~~~~~~
- Contains hyper's exceptions.
- """
- class ChunkedDecodeError(Exception):
- """
- An error was encountered while decoding a chunked response.
- """
- pass
- class InvalidResponseError(Exception):
- """
- A problem was found with the response that makes it invalid.
- """
- pass
- class SocketError(Exception):
- """
- An error occurred during socket operation.
- """
- pass
- class LineTooLongError(Exception):
- """
- An attempt to read a line from a socket failed because no newline was
- found.
- """
- pass
- # Create our own ConnectionResetError.
- try: # pragma: no cover
- ConnectionResetError = ConnectionResetError
- except NameError: # pragma: no cover
- class ConnectionResetError(Exception):
- """
- A HTTP connection was unexpectedly reset.
- """
- class TLSUpgrade(Exception):
- """
- We upgraded to a new protocol in the NPN/ALPN handshake.
- """
- def __init__(self, negotiated, sock):
- super(TLSUpgrade, self).__init__()
- self.negotiated = negotiated
- self.sock = sock
- class HTTPUpgrade(Exception):
- """
- We upgraded to a new protocol via the HTTP Upgrade response.
- """
- def __init__(self, negotiated, sock):
- super(HTTPUpgrade, self).__init__()
- self.negotiated = negotiated
- self.sock = sock
- class MissingCertFile(Exception):
- """
- The certificate file could not be found.
- """
- pass
|