A Python UPnP Media Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.9 KiB

  1. """
  2. ################################################################################
  3. #
  4. # SOAPpy - Cayce Ullman (cayce@actzero.com)
  5. # Brian Matthews (blm@actzero.com)
  6. # Gregory Warnes (gregory_r_warnes@groton.pfizer.com)
  7. # Christopher Blunck (blunck@gst.com)
  8. #
  9. ################################################################################
  10. # Copyright (c) 2003, Pfizer
  11. # Copyright (c) 2001, Cayce Ullman.
  12. # Copyright (c) 2001, Brian Matthews.
  13. #
  14. # All rights reserved.
  15. #
  16. # Redistribution and use in source and binary forms, with or without
  17. # modification, are permitted provided that the following conditions are met:
  18. # Redistributions of source code must retain the above copyright notice, this
  19. # list of conditions and the following disclaimer.
  20. #
  21. # Redistributions in binary form must reproduce the above copyright notice,
  22. # this list of conditions and the following disclaimer in the documentation
  23. # and/or other materials provided with the distribution.
  24. #
  25. # Neither the name of actzero, inc. nor the names of its contributors may
  26. # be used to endorse or promote products derived from this software without
  27. # specific prior written permission.
  28. #
  29. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  30. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
  33. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  34. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  35. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  36. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  38. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. #
  40. ################################################################################
  41. """
  42. ident = '$Id: Errors.py,v 1.4 2004/01/31 04:20:05 warnes Exp $'
  43. from version import __version__
  44. import exceptions
  45. ################################################################################
  46. # Exceptions
  47. ################################################################################
  48. class Error(exceptions.Exception):
  49. def __init__(self, msg):
  50. self.msg = msg
  51. def __str__(self):
  52. return "<Error : %s>" % self.msg
  53. __repr__ = __str__
  54. def __call__(self):
  55. return (msg,)
  56. class RecursionError(Error):
  57. pass
  58. class UnknownTypeError(Error):
  59. pass
  60. class HTTPError(Error):
  61. # indicates an HTTP protocol error
  62. def __init__(self, code, msg):
  63. self.code = code
  64. self.msg = msg
  65. def __str__(self):
  66. return "<HTTPError %s %s>" % (self.code, self.msg)
  67. __repr__ = __str__
  68. def __call___(self):
  69. return (self.code, self.msg, )
  70. class UnderflowError(exceptions.ArithmeticError):
  71. pass