You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2021/01/03 06:38:52 UTC

[GitHub] [drill] luocooong commented on a change in pull request #2127: DRILL-7552: Add Helpful Error Message on Storage Plugin Creation/Update

luocooong commented on a change in pull request #2127:
URL: https://github.com/apache/drill/pull/2127#discussion_r550964089



##########
File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistryImpl.java
##########
@@ -420,9 +420,13 @@ public void validatedPut(String name, StoragePluginConfig config)
       PluginHandle entry = restoreFromEphemeral(name, config);
       try {
         entry.plugin();
+      } catch (UserException e) {
+        // Provide helpful error messages.
+        throw new PluginException(e.getOriginalMessage(), e);
       } catch (Exception e) {
         throw new PluginException(String.format(
-            "Invalid plugin config for '%s'", name), e);
+            "Invalid plugin config for '%s', "
+          + "Please switch to Logs panel from the UI then check the log.", name), e);

Review comment:
       @cgivre Hello. I think this change can alleviate the following problems: 
   1. If we create a plugin based on storage plugin (such as `JDBC` `Mongo` `Hbase` `Hive` `Http` and any plugins that extends `AbstractStoragePlugin`), we can get a better error message. because we are actively throw UserException at `org.apache.drill.exec.store.PluginHandle#plugin()`.
   2. There is a difference between `getOriginalMessage()` and `getMessage()` in `UserException` class (In fact, getMessage() == ErrorType + Description Text + getOriginalMessage() + Context Message). I prefer the former(more clearly).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org