Skip to content

Improve Elasticsearch error handling for 404 and empty responses#192

Open
sujen1412 wants to merge 1 commit intodevelopfrom
claude/improve-es-error-handling-012bhciFGmuJpq1nRCfktfjY
Open

Improve Elasticsearch error handling for 404 and empty responses#192
sujen1412 wants to merge 1 commit intodevelopfrom
claude/improve-es-error-handling-012bhciFGmuJpq1nRCfktfjY

Conversation

@sujen1412
Copy link
Collaborator

Enhanced error handling in get_hysds_io() and get_job_spec() functions to properly handle:

  • HTTP 404 responses when algorithm specifications are not found
  • Other HTTP error status codes (4xx, 5xx)
  • Invalid JSON responses
  • Empty result sets from Elasticsearch queries
  • Network/connection errors

This provides clearer error messages to users when algorithms are not registered or when ES queries fail, making it easier to diagnose issues with job submissions.

Enhanced error handling in get_hysds_io() and get_job_spec() functions to properly handle:
- HTTP 404 responses when algorithm specifications are not found
- Other HTTP error status codes (4xx, 5xx)
- Invalid JSON responses
- Empty result sets from Elasticsearch queries
- Network/connection errors

This provides clearer error messages to users when algorithms are not registered or when
ES queries fail, making it easier to diagnose issues with job submissions.
@sujen1412 sujen1412 self-assigned this Dec 5, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@grallewellyn
Copy link
Member

Should we merge this instead into 2i2c-release so this is in the release next week? We were going to merge 2i2c-release into main for the release, then main back into develop after the release

@sujen1412
Copy link
Collaborator Author

sure, this is also something needed in UAT. So however it works. Will need to test the edge cases on the 2i2c-release deployed API for appropriate responses if we are not merging to dev first.

Copy link
Member

@grallewellyn grallewellyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this in the 2i2c API release we already did? Because we missed this PR

We can at least get this into develop and release/5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants