forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code to handle review comments and introduce new exception
Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
- Loading branch information
Showing
12 changed files
with
388 additions
and
243 deletions.
There are no files selected for viewing
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
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
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
144 changes: 0 additions & 144 deletions
144
server/src/main/java/org/opensearch/rest/RequestLimitSettings.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
server/src/main/java/org/opensearch/rest/ResponseLimitBreachedException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.rest; | ||
|
||
import org.opensearch.OpenSearchException; | ||
import org.opensearch.core.common.io.stream.StreamInput; | ||
import org.opensearch.core.rest.RestStatus; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Thrown when api response limit threshold exceeds | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class ResponseLimitBreachedException extends OpenSearchException { | ||
|
||
public ResponseLimitBreachedException(String msg) { | ||
super(msg); | ||
} | ||
|
||
public ResponseLimitBreachedException(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
|
||
@Override | ||
public RestStatus status() { | ||
return RestStatus.TOO_MANY_REQUESTS; | ||
} | ||
} |
Oops, something went wrong.