OWSExceptions.py 801 B

123456789101112131415161718192021222324
  1. class OWSException(Exception):
  2. pass
  3. class WMSException(OWSException):
  4. def toXml(self):
  5. print """Content-type: text/xml\n"""
  6. print """<?xml version="1.0" ?>
  7. <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc"
  8. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
  10. <ServiceException code="%s" locator="%s"><![CDATA[
  11. %s
  12. ]]></ServiceException>
  13. </ServiceExceptionReport>""" % \
  14. (self.__class__.__name__,self.message,self.args)
  15. class MissingParameterValue(WMSException):
  16. pass
  17. class RequestFailed(WMSException):
  18. pass
  19. class NoValidRequest(WMSException):
  20. pass