chore: adding support for multiple-environment error messages (#26005)
## Description > Support PR for EE error handling for multiple-environments - To support the error handling in EE, this PR addresses refactoring of methods Fixes https://github.com/appsmithorg/appsmith/issues/25964 Ref: https://github.com/appsmithorg/appsmith-ee/pull/1980
This commit is contained in:
parent
da3fd27cc2
commit
cadae671d3
|
|
@ -92,8 +92,7 @@ public class DatasourceStorageServiceCEImpl implements DatasourceStorageServiceC
|
|||
|
||||
return Mono.just(datasourceStorage);
|
||||
})
|
||||
.switchIfEmpty(Mono.error(new AppsmithException(
|
||||
AppsmithError.NO_RESOURCE_FOUND, FieldName.DATASOURCE, datasource.getName())));
|
||||
.switchIfEmpty(Mono.defer(() -> errorMonoWhenDatasourceStorageNotFound(datasource, environmentId)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -341,4 +340,10 @@ public class DatasourceStorageServiceCEImpl implements DatasourceStorageServiceC
|
|||
public Mono<String> getEnvironmentNameFromEnvironmentIdForAnalytics(String environmentId) {
|
||||
return Mono.just(FieldName.UNUSED_ENVIRONMENT_ID);
|
||||
}
|
||||
|
||||
protected Mono<DatasourceStorage> errorMonoWhenDatasourceStorageNotFound(
|
||||
Datasource datasource, String environmentId) {
|
||||
return Mono.error(
|
||||
new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, FieldName.DATASOURCE, datasource.getName()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,9 +211,6 @@ public class DatasourceStorageServiceTest {
|
|||
String datasourceId = "datasourceForUnsavedStorage";
|
||||
String environmentIdOne = FieldName.UNUSED_ENVIRONMENT_ID;
|
||||
|
||||
Mockito.when(pluginExecutorHelper.getPluginExecutor(Mockito.any()))
|
||||
.thenReturn(Mono.just(new MockPluginExecutor()));
|
||||
|
||||
Datasource datasource = new Datasource();
|
||||
datasource.setId(datasourceId);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user