You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/11/23 04:11:49 UTC

[GitHub] [druid] asdf2014 commented on a change in pull request #11723: Improve exception message when loading data from web-console

asdf2014 commented on a change in pull request #11723:
URL: https://github.com/apache/druid/pull/11723#discussion_r754791590



##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamSamplerSpec.java
##########
@@ -92,9 +93,22 @@ public SamplerResponse sample()
       );
       inputFormat = null;
     } else {
+      RecordSupplier<PartitionIdType, SequenceOffsetType, RecordType> recordSupplier;
+
+      try {
+        recordSupplier = createRecordSupplier();
+      }
+      catch (Exception e) {
+        if (e.getCause() != null) {
+          throw new SamplerException(e, "Unable to create RecordSupplier: %s. Cause: %s", e.getMessage(), e.getCause().getMessage());

Review comment:
       How about using this Druid style, as follows:
   
   ```suggestion
             throw new SamplerException(e, "Unable to create RecordSupplier: %s because: %s", e.getMessage(), e.getCause().getMessage());
   ```

##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamSamplerSpec.java
##########
@@ -92,9 +93,22 @@ public SamplerResponse sample()
       );
       inputFormat = null;
     } else {
+      RecordSupplier<PartitionIdType, SequenceOffsetType, RecordType> recordSupplier;
+
+      try {
+        recordSupplier = createRecordSupplier();
+      }
+      catch (Exception e) {
+        if (e.getCause() != null) {
+          throw new SamplerException(e, "Unable to create RecordSupplier: %s. Cause: %s", e.getMessage(), e.getCause().getMessage());

Review comment:
       It's very useful to print the cause, but in this situation, I might want to know the root cause, so maybe we can use `Throwables.getRootCause(xxx)` instead.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org