PageRenderTime 37ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/cpl/error.py

http://pyccsm.googlecode.com/
Python | 69 lines | 54 code | 9 blank | 6 comment | 0 complexity | d57e5d07d7d798bf339ea8d1dcf25e51 MD5 | raw file
  1. """
  2. error.py
  3. This module defines a series of exceptions to make it easier to deal with
  4. error handling in the coupler.
  5. """
  6. class CPLException(Exception):
  7. def __init__(self, value="Nobody should throw me!"):
  8. Exception.__init__(self)
  9. self.value = value
  10. def __str__(self):
  11. return repr(self.value)
  12. class AttributeVectorError(CPLException):
  13. def __init__(self, value="No error message provided"):
  14. Exception.__init__(self)
  15. self.value = value
  16. def __str__(self):
  17. return repr(self.value)
  18. class BundleError(CPLException):
  19. def __init__(self, value="No error message provided"):
  20. Exception.__init__(self)
  21. self.value = value
  22. def __str__(self):
  23. return repr(self.value)
  24. class CommError(CPLException):
  25. def __init__(self, value="No error message provided"):
  26. Exception.__init__(self)
  27. self.value = value
  28. def __str__(self):
  29. return repr(self.value)
  30. class ContractError(CPLException):
  31. def __init__(self, value="No error message provided"):
  32. Exception.__init__(self)
  33. self.value = value
  34. def __str__(self):
  35. return repr(self.value)
  36. class ControlError(CPLException):
  37. def __init__(self, value="No error message provided"):
  38. Exception.__init__(self)
  39. self.value = value
  40. def __str__(self):
  41. return repr(self.value)
  42. class DomainError(CPLException):
  43. def __init__(self, value="No error message provided"):
  44. Exception.__init__(self)
  45. self.value = value
  46. def __str__(self):
  47. return repr(self.value)
  48. class FieldsError(CPLException):
  49. def __init__(self, value="No error message provided"):
  50. Exception.__init__(self)
  51. self.value = value
  52. def __str__(self):
  53. return repr(self.value)
  54. class InfobufferError(CPLException):
  55. def __init__(self, value="No error message provided"):
  56. Exception.__init__(self)
  57. self.value = value
  58. def __str__(self):
  59. return repr(self.value)