You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/06/29 18:21:48 UTC
[incubator-streampipes] 02/02: [hotfix] Improve error message of guess schema result
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 7d81a22ad3ade37c94e835a8d255eeba1c68c11c
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Wed Jun 29 20:21:38 2022 +0200
[hotfix] Improve error message of guess schema result
---
.../connect/container/master/management/GuessManagement.java | 9 +--------
.../execution/endpoint/ExtensionsServiceEndpointGenerator.java | 2 +-
.../org/apache/streampipes/rest/impl/connect/GuessResource.java | 2 +-
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java
index 0d867bbd3..f5385e317 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java
@@ -26,7 +26,6 @@ import org.apache.http.client.fluent.Response;
import org.apache.http.entity.ContentType;
import org.apache.http.util.EntityUtils;
import org.apache.streampipes.commons.exceptions.NoServiceEndpointsAvailableException;
-import org.apache.streampipes.connect.api.exception.AdapterException;
import org.apache.streampipes.connect.api.exception.ParseException;
import org.apache.streampipes.connect.api.exception.WorkerAdapterException;
import org.apache.streampipes.connect.container.master.util.WorkerPaths;
@@ -48,8 +47,7 @@ public class GuessManagement {
this.workerUrlProvider = new WorkerUrlProvider();
}
- public GuessSchema guessSchema(AdapterDescription adapterDescription) throws AdapterException, ParseException, WorkerAdapterException {
- try {
+ public GuessSchema guessSchema(AdapterDescription adapterDescription) throws ParseException, WorkerAdapterException, NoServiceEndpointsAvailableException, IOException {
String workerUrl = workerUrlProvider.getWorkerBaseUrl(adapterDescription.getAppId());
workerUrl = workerUrl + WorkerPaths.getGuessSchemaPath();
@@ -74,11 +72,6 @@ public class GuessManagement {
LOG.error(errorMessage.getElementName());
throw new WorkerAdapterException(errorMessage);
}
-
- } catch (IOException | NoServiceEndpointsAvailableException e) {
- LOG.error(e.getMessage());
- throw new AdapterException("Error in connect worker: ", e);
- }
}
}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/endpoint/ExtensionsServiceEndpointGenerator.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/endpoint/ExtensionsServiceEndpointGenerator.java
index b3feb3bee..8d430e46c 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/endpoint/ExtensionsServiceEndpointGenerator.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/endpoint/ExtensionsServiceEndpointGenerator.java
@@ -65,7 +65,7 @@ public class ExtensionsServiceEndpointGenerator {
return getServiceEndpoints().get(0);
} else {
LOG.error("Could not find any service endpoints for appId {}, serviceTag {}", appId, this.spServiceUrlProvider.getServiceTag(appId).asString());
- throw new NoServiceEndpointsAvailableException("Could not find any matching service endpoints");
+ throw new NoServiceEndpointsAvailableException("Could not find any matching service endpoints - are all software components running?");
}
}
}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
index 474c119a0..6593be344 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
@@ -60,7 +60,7 @@ public class GuessResource extends AbstractAdapterResource<GuessManagement> {
} catch (WorkerAdapterException e) {
return serverError(e.getContent());
} catch (Exception e) {
- LOG.error("Error while guess schema for AdapterDescription: ", e);
+ LOG.error("Error while guessing the schema for AdapterDescription: {}", e.getMessage());
return serverError(Notifications.error(e.getMessage()));
}
}