errors.py 376 B

123456789101112131415161718192021222324
  1. class SocketClosed(Exception):
  2. def __init__(self, initialized):
  3. self.initialized = initialized
  4. @property
  5. def message(self):
  6. s = 'socket closed'
  7. if self.initialized:
  8. s += ' (initialized)'
  9. return s
  10. class HandshakeError(Exception):
  11. pass
  12. class PingError(Exception):
  13. pass
  14. class SSLError(Exception):
  15. pass