Classify the Plugin errors to Action and Datasource configuration issues (#7095)
This commit is contained in:
parent
93ce03c765
commit
a4434872b0
|
|
@ -9,7 +9,8 @@ import java.text.MessageFormat;
|
||||||
@Getter
|
@Getter
|
||||||
public enum AppsmithPluginError {
|
public enum AppsmithPluginError {
|
||||||
|
|
||||||
PLUGIN_ERROR(500, 5000, "{0}", AppsmithErrorAction.LOG_EXTERNALLY, "Query execution error", ErrorType.INTERNAL_ERROR),
|
PLUGIN_ERROR(500, 5000, "{0}",
|
||||||
|
AppsmithErrorAction.LOG_EXTERNALLY, "Query execution error", ErrorType.INTERNAL_ERROR),
|
||||||
PLUGIN_GET_STRUCTURE_ERROR(500, 5001, "{0}", AppsmithErrorAction.DEFAULT, "Failed to get datasource " +
|
PLUGIN_GET_STRUCTURE_ERROR(500, 5001, "{0}", AppsmithErrorAction.DEFAULT, "Failed to get datasource " +
|
||||||
"structure", ErrorType.INTERNAL_ERROR),
|
"structure", ErrorType.INTERNAL_ERROR),
|
||||||
PLUGIN_QUERY_TIMEOUT_ERROR(504, 5002, "{0} timed out in {1} milliseconds. " +
|
PLUGIN_QUERY_TIMEOUT_ERROR(504, 5002, "{0} timed out in {1} milliseconds. " +
|
||||||
|
|
@ -21,8 +22,9 @@ public enum AppsmithPluginError {
|
||||||
PLUGIN_GET_STRUCTURE_TIMEOUT_ERROR(504, 5003, "{0}", AppsmithErrorAction.LOG_EXTERNALLY, "Timed out when fetching" +
|
PLUGIN_GET_STRUCTURE_TIMEOUT_ERROR(504, 5003, "{0}", AppsmithErrorAction.LOG_EXTERNALLY, "Timed out when fetching" +
|
||||||
" datasource structure", ErrorType.CONNECTIVITY_ERROR),
|
" datasource structure", ErrorType.CONNECTIVITY_ERROR),
|
||||||
PLUGIN_DATASOURCE_ARGUMENT_ERROR(500, 5004, "{0}", AppsmithErrorAction.DEFAULT, "Datasource configuration is " +
|
PLUGIN_DATASOURCE_ARGUMENT_ERROR(500, 5004, "{0}", AppsmithErrorAction.DEFAULT, "Datasource configuration is " +
|
||||||
"invalid", ErrorType.ARGUMENT_ERROR),
|
"invalid", ErrorType.DATASOURCE_CONFIGURATION_ERROR),
|
||||||
PLUGIN_EXECUTE_ARGUMENT_ERROR(500, 5005, "{0}", AppsmithErrorAction.DEFAULT, "Query configuration is invalid", ErrorType.ARGUMENT_ERROR),
|
PLUGIN_EXECUTE_ARGUMENT_ERROR(500, 5005, "{0}", AppsmithErrorAction.DEFAULT,
|
||||||
|
"Query configuration is invalid", ErrorType.ACTION_CONFIGURATION_ERROR),
|
||||||
PLUGIN_JSON_PARSE_ERROR(500, 5006, "Plugin failed to parse JSON \"{0}\" with error: {1}",
|
PLUGIN_JSON_PARSE_ERROR(500, 5006, "Plugin failed to parse JSON \"{0}\" with error: {1}",
|
||||||
AppsmithErrorAction.DEFAULT, "Invalid JSON found", ErrorType.INTERNAL_ERROR),
|
AppsmithErrorAction.DEFAULT, "Invalid JSON found", ErrorType.INTERNAL_ERROR),
|
||||||
PLUGIN_DATASOURCE_TEST_GENERIC_ERROR(500, 5007, "Plugin failed to test with the given configuration. Please reach out to Appsmith customer support to report this",
|
PLUGIN_DATASOURCE_TEST_GENERIC_ERROR(500, 5007, "Plugin failed to test with the given configuration. Please reach out to Appsmith customer support to report this",
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ public enum ErrorType {
|
||||||
CONNECTIVITY_ERROR,
|
CONNECTIVITY_ERROR,
|
||||||
AUTHENTICATION_ERROR,
|
AUTHENTICATION_ERROR,
|
||||||
BAD_REQUEST,
|
BAD_REQUEST,
|
||||||
INTERNAL_ERROR
|
INTERNAL_ERROR,
|
||||||
|
ACTION_CONFIGURATION_ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,19 +37,19 @@ public class AppendMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");
|
||||||
}
|
}
|
||||||
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected value for table header index. Please use a number starting from 1");
|
"Unexpected value for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected format for table header index. Please use a number starting from 1");
|
"Unexpected format for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,19 +38,19 @@ public class BulkAppendMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");
|
||||||
}
|
}
|
||||||
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected value for table header index. Please use a number starting from 1");
|
"Unexpected value for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected format for table header index. Please use a number starting from 1");
|
"Unexpected format for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,19 +38,19 @@ public class BulkUpdateMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");
|
||||||
}
|
}
|
||||||
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected value for table header index. Please use a number starting from 1");
|
"Unexpected value for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected format for table header index. Please use a number starting from 1");
|
"Unexpected format for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ public class ClearMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSpreadsheetRange() == null || methodConfig.getSpreadsheetRange().isBlank()) {
|
if (methodConfig.getSpreadsheetRange() == null || methodConfig.getSpreadsheetRange().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Data Range");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Data Range");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ public class CopyMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSheetId() == null || methodConfig.getSheetId().isBlank()) {
|
if (methodConfig.getSheetId() == null || methodConfig.getSheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet Id");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet Id");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,33 +30,33 @@ public class DeleteRowMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");
|
||||||
}
|
}
|
||||||
if (methodConfig.getRowIndex() == null || methodConfig.getRowIndex().isBlank()) {
|
if (methodConfig.getRowIndex() == null || methodConfig.getRowIndex().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Row index");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Row index");
|
||||||
}
|
}
|
||||||
int rowIndex = 0;
|
int rowIndex = 0;
|
||||||
try {
|
try {
|
||||||
rowIndex = Integer.parseInt(methodConfig.getRowIndex());
|
rowIndex = Integer.parseInt(methodConfig.getRowIndex());
|
||||||
if (rowIndex < 0) {
|
if (rowIndex < 0) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected value for row index. Please use a number starting from 0");
|
"Unexpected value for row index. Please use a number starting from 0");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected format for row index. Please use a number starting from 0");
|
"Unexpected format for row index. Please use a number starting from 0");
|
||||||
}
|
}
|
||||||
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected value for table header index. Please use a number starting from 1");
|
"Unexpected value for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected format for table header index. Please use a number starting from 1");
|
"Unexpected format for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,19 +35,19 @@ public class UpdateMethod implements Method {
|
||||||
@Override
|
@Override
|
||||||
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
public boolean validateMethodRequest(MethodConfig methodConfig) {
|
||||||
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Spreadsheet Url");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");
|
||||||
}
|
}
|
||||||
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field Sheet name");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");
|
||||||
}
|
}
|
||||||
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected value for table header index. Please use a number starting from 1");
|
"Unexpected value for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR,
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
|
||||||
"Unexpected format for table header index. Please use a number starting from 1");
|
"Unexpected format for table header index. Please use a number starting from 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,12 @@ public class RowObject {
|
||||||
|
|
||||||
public RowObject initialize() {
|
public RowObject initialize() {
|
||||||
if (this.rowIndex == null) {
|
if (this.rowIndex == null) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing required field row index.");
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field row index.");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.currentRowIndex = Integer.parseInt(this.rowIndex);
|
this.currentRowIndex = Integer.parseInt(this.rowIndex);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Unable to parse row index: " + this.rowIndex);
|
throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Unable to parse row index: " + this.rowIndex);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ public class RestApiPlugin extends BasePlugin {
|
||||||
ActionExecutionRequest actionExecutionRequest =
|
ActionExecutionRequest actionExecutionRequest =
|
||||||
RequestCaptureFilter.populateRequestFields(actionConfiguration, null, insertedParams, objectMapper);
|
RequestCaptureFilter.populateRequestFields(actionConfiguration, null, insertedParams, objectMapper);
|
||||||
actionExecutionRequest.setUrl(url);
|
actionExecutionRequest.setUrl(url);
|
||||||
errorResult.setBody(AppsmithPluginError.PLUGIN_ERROR.getMessage(e));
|
errorResult.setBody(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR.getMessage(e));
|
||||||
errorResult.setRequest(actionExecutionRequest);
|
errorResult.setRequest(actionExecutionRequest);
|
||||||
return Mono.just(errorResult);
|
return Mono.just(errorResult);
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +242,7 @@ public class RestApiPlugin extends BasePlugin {
|
||||||
RequestCaptureFilter.populateRequestFields(actionConfiguration, uri, insertedParams, objectMapper);
|
RequestCaptureFilter.populateRequestFields(actionConfiguration, uri, insertedParams, objectMapper);
|
||||||
|
|
||||||
if (httpMethod == null) {
|
if (httpMethod == null) {
|
||||||
errorResult.setBody(AppsmithPluginError.PLUGIN_ERROR.getMessage("HTTPMethod must be set."));
|
errorResult.setBody(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR.getMessage("HTTPMethod must be set."));
|
||||||
errorResult.setRequest(actionExecutionRequest);
|
errorResult.setRequest(actionExecutionRequest);
|
||||||
return Mono.just(errorResult);
|
return Mono.just(errorResult);
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +264,7 @@ public class RestApiPlugin extends BasePlugin {
|
||||||
// Check for content type
|
// Check for content type
|
||||||
final String contentTypeError = verifyContentType(actionConfiguration.getHeaders());
|
final String contentTypeError = verifyContentType(actionConfiguration.getHeaders());
|
||||||
if (contentTypeError != null) {
|
if (contentTypeError != null) {
|
||||||
errorResult.setBody(AppsmithPluginError.PLUGIN_ERROR.getMessage("Invalid value for Content-Type."));
|
errorResult.setBody(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR.getMessage("Invalid value for Content-Type."));
|
||||||
errorResult.setRequest(actionExecutionRequest);
|
errorResult.setRequest(actionExecutionRequest);
|
||||||
return Mono.just(errorResult);
|
return Mono.just(errorResult);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user