arina-ielchiieva commented on a change in pull request #1379: DRILL-6591: Show 
Exception for failed queries submitted in WebUI
URL: https://github.com/apache/drill/pull/1379#discussion_r202427605
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
 ##########
 @@ -97,21 +97,22 @@ public QueryResult run(final WorkManager workManager, 
final WebUserConnection we
 
     //Fail if nearly out of heap space
     if (nearlyOutOfHeapSpace) {
+      UserException almostOutOfHeapException = UserException.resourceError()
+          .message("There is not enough heap memory to run this query using 
the web interface. ")
+          .addContext("Please try a query with fewer columns or with a filter 
or limit condition to limit the data returned. ")
+          .addContext("You can also try an ODBC/JDBC client. ")
+          .build(logger);
+      //Add event
       workManager.getBee().getForemanForQueryId(queryId)
-        .addToEventQueue(QueryState.FAILED,
-            UserException.resourceError(
-                new Throwable(
-                    "There is not enough heap memory to run this query using 
the web interface. "
-                    + "Please try a query with fewer columns or with a filter 
or limit condition to limit the data returned. "
-                    + "You can also try an ODBC/JDBC client. "
-                    )
-                )
-              .build(logger)
-            );
+        .addToEventQueue(QueryState.FAILED, almostOutOfHeapException);
+      //Return NearlyOutOfHeap exception
+      throw almostOutOfHeapException;
 
 Review comment:
   We did not throw exception before, why we are throwing it now?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to