Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1048#discussion_r37756262
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClient.java ---
    @@ -160,12 +159,12 @@ public static SerializedJobExecutionResult 
submitJobAndWait(
     
                                SerializedJobExecutionResult result = 
((JobManagerMessages.JobResultSuccess) answer).result();
                                if (result != null) {
    -                                   return result;
    +                                   return 
result.toJobExecutionResult(usercodeClassloader);
                                } else {
                                        throw new Exception("Job was 
successfully executed but result contained a null JobExecutionResult.");
                                }
    -                   } else if (answer instanceof Status.Failure) {
    -                           throw ((Status.Failure) answer).cause();
    +                   } else if (answer instanceof 
JobClientMessages.JobFailure) {
    --- End diff --
    
    Why do we introduce a new `JobFailure` message here? Can't we simply let 
our `SerializedThrowable` class inherit from `Exception` and send it as a 
failure over the network? We then only have to add in the outer try block a 
catch block which deserializes the wrapped exception.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to