-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/error typology #183
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LGTM. I tested this: import cads_api_client
client = cads_api_client.ApiClient()
collection_id = "reanalysis-era5-land-monthly-means"
request = {
"product_type": ["monthly_averaged_reanalysis"],
"variable": ["u_component_of_wind", "v_component_of_wind", "2m_temperature"],
"year": "2023",
"month": "01",
"format": "grib",
}
client.retrieve(collection_id, **request) and I got this: ---------------------------------------------------------------------------
ProcessingFailedError Traceback (most recent call last)
Cell In[5], line 1
----> 1 client.retrieve(collection_id, **request)
File /src/cads-api-client/cads_api_client/api_client.py:68, in ApiClient.retrieve(self, collection_id, target, retry_options, **request)
60 def retrieve(
61 self,
62 collection_id: str,
(...)
65 **request: Any,
66 ) -> str:
67 collection = self.collection(collection_id)
---> 68 return collection.retrieve(
69 target,
70 retry_options=retry_options,
71 **request,
72 )
File /src/cads-api-client/cads_api_client/catalogue.py:64, in Collection.retrieve(self, target, retry_options, **request)
57 def retrieve(
58 self,
59 target: Optional[str] = None,
60 retry_options: Dict[str, Any] = {},
61 **request: Any,
62 ) -> str:
63 remote = self.submit(**request)
---> 64 return remote.download(target, retry_options=retry_options)
File /src/cads-api-client/cads_api_client/processing.py:289, in Remote.download(self, target, retry_options)
286 def download(
287 self, target: Optional[str] = None, retry_options: Dict[str, Any] = {}
288 ) -> str:
--> 289 self.wait_on_result(retry_options=retry_options)
290 return self._download_result(target, retry_options=retry_options)
File /src/cads-api-client/cads_api_client/processing.py:240, in Remote.wait_on_result(self, retry_options)
238 elif status == "failed":
239 results = multiurl.robust(self.make_results, **retry_options)(self.url)
--> 240 raise ProcessingFailedError(error_json_to_message(results.json))
241 elif status in ("accepted", "running"):
242 sleep *= 1.5
ProcessingFailedError: The job has failed.
MARS returned no data, please check your selection.Request submitted to the MARS server:
[{'dataset': ['reanalysis-monthly-means-of-daily-means'], 'param': ['u_component_of_wind', 'v_component_of_wind', '167'], 'class': ['l5'], 'expect': ['any'], 'number': ['all'], 'levtype': ['sfc'], 'date': ['2023-01-01']}]
The job failed with: MarsNoDataError |
And this is the expected error, i.e. on cds-beta this currently returns RuntimeError but at the same point in the code |
malmans2
approved these changes
Jul 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that the broker can handle custom exceptions we should make use of them, this information will then be available in Splunk for categorising failed requests