Datasource exceptions are being suppressed, preventing notification to the caller. To address this, I made some changes across several files.
Next, I plan to create a custom DatasourceException class to specifically handle datasource-related exceptions. This class will help determine if an exception occurred during /up metrics retrieval,
fetching metadata at the namespace, workload, or container level,
or while obtaining specific metrics
This PR improves error handling for Datasource connections by addressing the suppression of exceptions like SocketTimeoutException and ConnectTimeoutException. These exceptions will now be rethrown, enabling the REST API to return appropriate HTTP status codes:
504 Gateway Timeout: For requests that time out while waiting for a response.
503 Service Unavailable: For connections that cannot be established to the Datasource.
Fixes # (issue)
Type of change
[x] Bug fix
[ ] New feature
[ ] Docs update
[ ] Breaking change (What changes might users need to make in their application due to this PR?)
[ ] Requires DB changes
How has this been tested?
Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.
[ ] New Test X
[x] Functional testsuite
Test Configuration
Kubernetes clusters tested on:
Checklist :dart:
[x] Followed coding guidelines
[x] Comments added
[ ] Dependent changes merged
[ ] Documentation updated
[ ] Tests added or updated
Additional information
Include any additional information such as links, test results, screenshots here
Description
Datasource exceptions are being suppressed, preventing notification to the caller. To address this, I made some changes across several files. Next, I plan to create a custom DatasourceException class to specifically handle datasource-related exceptions. This class will help determine if an exception occurred during /up metrics retrieval, fetching metadata at the namespace, workload, or container level, or while obtaining specific metrics
This PR improves error handling for Datasource connections by addressing the suppression of exceptions like SocketTimeoutException and ConnectTimeoutException. These exceptions will now be rethrown, enabling the REST API to return appropriate HTTP status codes:
504 Gateway Timeout: For requests that time out while waiting for a response. 503 Service Unavailable: For connections that cannot be established to the Datasource.
Fixes # (issue)
Type of change
How has this been tested?
Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.
Test Configuration
Checklist :dart:
Additional information
Include any additional information such as links, test results, screenshots here