Skip to content

Commit

Permalink
Replace strings in 40 files
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Cmil <[email protected]>
  • Loading branch information
KirrTap committed Nov 4, 2024
1 parent 7e02230 commit 7cd4a0e
Show file tree
Hide file tree
Showing 30 changed files with 319 additions and 91 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -193,8 +194,9 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
throw ex;
} else {
RestStatus status = ex instanceof IOException ? RestStatus.BAD_REQUEST : ExceptionsHelper.status(ex);
String errorMessage =
"failure parsing request body when a use case is given, make sure to provide a map with values that are either Strings, Arrays, or Map of Strings to Strings";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 197 in src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java#L197

Added line #L197 was not covered by tests
"failure parsing request body when a use case is given, make sure to provide a map with values that are either Strings, Arrays, or Map of Strings to Strings"
).getFormattedMessage();

Check warning on line 199 in src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java#L199

Added line #L199 was not covered by tests
logger.error(errorMessage, ex);
throw new FlowFrameworkException(errorMessage, status);
}
Expand Down Expand Up @@ -242,7 +244,9 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back create workflow exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 247 in src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java#L247

Added line #L247 was not covered by tests
"IOException: Failed to send back create workflow exception"
).getFormattedMessage();

Check warning on line 249 in src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java#L249

Added line #L249 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -92,7 +93,9 @@ protected BaseRestHandler.RestChannelConsumer prepareRequest(RestRequest request
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back delete workflow exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 96 in src/main/java/org/opensearch/flowframework/rest/RestDeleteWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestDeleteWorkflowAction.java#L96

Added line #L96 was not covered by tests
"IOException: Failed to send back delete workflow exception"
).getFormattedMessage();

Check warning on line 98 in src/main/java/org/opensearch/flowframework/rest/RestDeleteWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestDeleteWorkflowAction.java#L98

Added line #L98 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -94,7 +95,9 @@ protected BaseRestHandler.RestChannelConsumer prepareRequest(RestRequest request
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back deprovision workflow exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 98 in src/main/java/org/opensearch/flowframework/rest/RestDeprovisionWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestDeprovisionWorkflowAction.java#L98

Added line #L98 was not covered by tests
"IOException: Failed to send back deprovision workflow exception"
).getFormattedMessage();

Check warning on line 100 in src/main/java/org/opensearch/flowframework/rest/RestDeprovisionWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestDeprovisionWorkflowAction.java#L100

Added line #L100 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -91,7 +92,9 @@ protected BaseRestHandler.RestChannelConsumer prepareRequest(RestRequest request
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back get workflow exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 95 in src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowAction.java#L95

Added line #L95 was not covered by tests
"IOException: Failed to send back get workflow exception"
).getFormattedMessage();

Check warning on line 97 in src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowAction.java#L97

Added line #L97 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -87,7 +88,9 @@ protected BaseRestHandler.RestChannelConsumer prepareRequest(RestRequest request
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back get workflow state exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 91 in src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStateAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStateAction.java#L91

Added line #L91 was not covered by tests
"IOException: Failed to send back get workflow state exception"
).getFormattedMessage();

Check warning on line 93 in src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStateAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStateAction.java#L93

Added line #L93 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -91,7 +92,9 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back get workflow step exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 95 in src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStepAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStepAction.java#L95

Added line #L95 was not covered by tests
"IOException: Failed to send back get workflow step exception"
).getFormattedMessage();

Check warning on line 97 in src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStepAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestGetWorkflowStepAction.java#L97

Added line #L97 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.opensearch.ExceptionsHelper;
import org.opensearch.client.node.NodeClient;
import org.opensearch.core.action.ActionListener;
Expand Down Expand Up @@ -98,7 +99,9 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));
} catch (IOException e) {
String errorMessage = "IOException: Failed to send back provision workflow exception";
String errorMessage = ParameterizedMessageFactory.INSTANCE.newMessage(

Check warning on line 102 in src/main/java/org/opensearch/flowframework/rest/RestProvisionWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestProvisionWorkflowAction.java#L102

Added line #L102 was not covered by tests
"IOException: Failed to send back provision workflow exception"
).getFormattedMessage();

Check warning on line 104 in src/main/java/org/opensearch/flowframework/rest/RestProvisionWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestProvisionWorkflowAction.java#L104

Added line #L104 was not covered by tests
logger.error(errorMessage, e);
channel.sendResponse(new BytesRestResponse(ExceptionsHelper.status(e), errorMessage));
}
Expand Down
Loading

0 comments on commit 7cd4a0e

Please sign in to comment.