zentol commented on a change in pull request #12505:
URL: https://github.com/apache/flink/pull/12505#discussion_r436808297



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
##########
@@ -1801,12 +1802,13 @@ public JobClient executeAsync(StreamGraph streamGraph) 
throws Exception {
                        JobClient jobClient = jobClientFuture.get();
                        jobListeners.forEach(jobListener -> 
jobListener.onJobSubmitted(jobClient, null));
                        return jobClient;
-               } catch (Throwable t) {
-                       jobListeners.forEach(jobListener -> 
jobListener.onJobSubmitted(null, t));
-                       ExceptionUtils.rethrow(t);
+               } catch (ExecutionException executionException) {
+                       final Throwable strippedException = 
ExceptionUtils.stripExecutionException(executionException);
+                       jobListeners.forEach(jobListener -> 
jobListener.onJobSubmitted(null, strippedException));
 
-                       // make javac happy, this code path will not be reached
-                       return null;
+                       throw new FlinkException(
+                               String.format("Failed to execute job '%s' 
asynchronously.", streamGraph.getJobName()),

Review comment:
       nit: given that `executeAsync` is also called by `execute`, this error 
message could be a bit confusing.




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


Reply via email to