-
Notifications
You must be signed in to change notification settings - Fork 38
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
Changes in invalid input handling #373
Conversation
1. Switch exception type from OpenSearchException to IllegalArgumentException for invalid endpoint 2. Add cluster state validation for update API Signed-off-by: Heemin Kim <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #373 +/- ##
============================================
- Coverage 88.65% 88.60% -0.06%
Complexity 752 752
============================================
Files 92 92
Lines 2707 2711 +4
Branches 219 220 +1
============================================
+ Hits 2400 2402 +2
- Misses 228 230 +2
Partials 79 79
|
@@ -94,6 +95,11 @@ protected void doExecute(final Task task, final UpdateDatasourceRequest request, | |||
if (datasource == null) { | |||
throw new ResourceNotFoundException("no such datasource exist"); | |||
} | |||
if (DatasourceState.AVAILABLE.equals(datasource.getState()) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use if(!DatasourceState.....)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== false
is more readable and preferred format borrowed from OpenSearch core.
1. Switch exception type from OpenSearchException to IllegalArgumentException for invalid endpoint 2. Add cluster state validation for update API Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit e1f41bb)
1. Switch exception type from OpenSearchException to IllegalArgumentException for invalid endpoint 2. Add cluster state validation for update API Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit e1f41bb) Co-authored-by: Heemin Kim <[email protected]>
Description
Issues Resolved
N/A
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.