exceptions.py 974 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # -*- coding: utf-8 -*-
  2. """
  3. hyper/http20/exceptions
  4. ~~~~~~~~~~~~~~~~~~~~~~~
  5. This defines exceptions used in the HTTP/2 portion of hyper.
  6. """
  7. class HPACKError(Exception):
  8. """
  9. The base class for all ``hpack`` exceptions.
  10. """
  11. pass
  12. class HPACKDecodingError(HPACKError):
  13. """
  14. An error has been encountered while performing HPACK decoding.
  15. """
  16. pass
  17. class InvalidTableIndex(HPACKDecodingError):
  18. """
  19. An invalid table index was received.
  20. """
  21. pass
  22. class OversizedHeaderListError(HPACKDecodingError):
  23. """
  24. A header list that was larger than we allow has been received. This may be
  25. a DoS attack.
  26. .. versionadded:: 2.3.0
  27. """
  28. pass
  29. class InvalidTableSizeError(HPACKDecodingError):
  30. """
  31. An attempt was made to change the decoder table size to a value larger than
  32. allowed, or the list was shrunk and the remote peer didn't shrink their
  33. table size.
  34. .. versionadded:: 3.0.0
  35. """
  36. pass