wolfboys commented on code in PR #1811: URL: https://github.com/apache/incubator-streampark/pull/1811#discussion_r992482812
########## streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/exception/AbstractApiException.java: ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.streampark.console.base.exception; + +/** + * <pre> + * An exception message that needs to be notified to front-end. + * </pre> + */ +public abstract class AbstractApiException extends RuntimeException { + + private final long responseCode; + + protected AbstractApiException(String message, long responseCode) { + super(message); + this.responseCode = responseCode; + } + + protected AbstractApiException(Throwable cause, long responseCode) { + super(cause); + this.responseCode = responseCode; + } + + protected AbstractApiException(String message, Throwable cause, long responseCode) { + super(message, cause); + this.responseCode = responseCode; + } + + public long getResponseCode() { + return responseCode; + } + + public abstract String getNotificationMessagePrefix(); Review Comment: I do not think this method is necessary, it can be simpler -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
