keith-turner commented on a change in pull request #1614:
URL: https://github.com/apache/accumulo/pull/1614#discussion_r428932975



##########
File path: 
core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
##########
@@ -576,7 +587,12 @@ private Text toText(byte[] row) {
         Thread.currentThread().interrupt();
         throw new RuntimeException(e);
       } catch (ExecutionException e) {
-        throw new RuntimeException(e);
+        // clean up exception for user
+        Throwable t = e.getCause();
+        if (t instanceof IllegalArgumentException) {
+          throw (IllegalArgumentException) t;
+        } else
+          throw new RuntimeException(t);
       }

Review comment:
       I would wrap `e` so that stack traces are not lost and anyone getting 
the exceptions can trace the full code path from their code to the background 
thread.
   
   ```suggestion
           Throwable t = e.getCause();
           if (t instanceof IllegalArgumentException) {
             throw new IllegalArgumentException(e);
           } else
             throw new RuntimeException(e);
         }
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to