[docs]classParameterParserException(Exception):"""Raised when a parameter value cannot be parsed."""pass
[docs]classTooManyResultsException(Exception):"""Raised when the query returns too many results."""pass
[docs]classProductDownloadException(Exception):"""Raised when the product cannot be downloaded."""pass
[docs]classSearchException(Exception):"""Raised when the search operation cannot be executed. Follows the OpenSearch GeoJSON Response Encoding specification: https://docs.opengeospatial.org/is/17-047r1/17-047r1.html#39 :ivar response: error response :vartype response: requests.Response :ivar body: JSON body of the response :vartype body: dict :ivar search_exceptions: list of reported search exceptions :vartype search_exceptions: list """def__init__(self,response:requests.Response,*args:object)->None:self.response=responsemessages=[]try:self.body=response.json()self.search_exceptions=self.body["exceptions"]exception_messages=[f"{e['locator']} - {e['exceptionText']}"if"locator"ineelsee["exceptionText"]foreinself.search_exceptions]messages.extend(exception_messages)exceptValueError:messages.append(response.content)super().__init__(*messages,*args)