tillrohrmann commented on a change in pull request #15105: URL: https://github.com/apache/flink/pull/15105#discussion_r591592778
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/registration/RegistrationResponse.java ########## @@ -42,30 +44,42 @@ public String toString() { // ---------------------------------------------------------------------------- - /** A rejected (declined) registration. */ - public static final class Decline extends RegistrationResponse { + /** A registration failure. */ + public static final class Failure extends RegistrationResponse { private static final long serialVersionUID = 1L; - /** The rejection reason. */ - private final String reason; + /** The failure reason. */ + private final SerializedThrowable reason; /** - * Creates a new rejection message. + * Creates a new failure message. * - * @param reason The reason for the rejection. + * @param reason The reason for the failure. */ - public Decline(String reason) { - this.reason = reason != null ? reason : "(unknown)"; + public Failure(Throwable reason) { + this.reason = new SerializedThrowable(reason); } - /** Gets the reason for the rejection. */ - public String getReason() { + /** Gets the reason for the failure. */ + public SerializedThrowable getReason() { return reason; } @Override public String toString() { - return "Registration Declined (" + reason + ')'; + return "Registration Failure (" + reason + ')'; + } + } + + // ---------------------------------------------------------------------------- + + /** A rejected (declined) registration. */ Review comment: Good point. I will add details to their JavaDocs. ---------------------------------------------------------------- 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