vdiravka commented on a change in pull request #1455: DRILL-6724: Convert 
IndexOutOfBounds exception to UserException with …
URL: https://github.com/apache/drill/pull/1455#discussion_r214906760
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
 ##########
 @@ -162,37 +162,23 @@ public void setup(final OperatorContext context, final 
OutputMutator output) thr
   }
 
   private void setupParser() throws IOException {
-    if(hadoopPath != null){
+    if (hadoopPath != null) {
       jsonReader.setSource(stream);
-    }else{
+    } else {
       jsonReader.setSource(embeddedContent);
     }
     jsonReader.setIgnoreJSONParseErrors(skipMalformedJSONRecords);
   }
 
   protected void handleAndRaise(String suffix, Exception e) throws 
UserException {
-
     String message = e.getMessage();
-    int columnNr = -1;
 
     if (e instanceof JsonParseException) {
-      final JsonParseException ex = (JsonParseException) e;
-      message = ex.getOriginalMessage();
-      columnNr = ex.getLocation().getColumnNr();
-    }
-
-    UserException.Builder exceptionBuilder = UserException.dataReadError(e)
-            .message("%s - %s", suffix, message);
-    if (columnNr > 0) {
-      exceptionBuilder.pushContext("Column ", columnNr);
-    }
-
-    if (hadoopPath != null) {
-      exceptionBuilder.pushContext("Record ", currentRecordNumberInFile())
-          .pushContext("File ", hadoopPath.toUri().getPath());
+      message = ((JsonParseException) e).getOriginalMessage();
 
 Review comment:
   redundant spaces here and above

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to