-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP][ISSUE-3007][Improve] Introduce a premise utils to reduce conditions check and exceptions processing #3513
Conversation
import java.util.Objects; | ||
|
||
/** Determine whether to throw an exception based on the check condition */ | ||
public class PremisesUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job
@@ -15,7 +15,7 @@ | |||
* limitations under the License. | |||
*/ | |||
|
|||
package org.apache.streampark.console.base.domain; | |||
package org.apache.streampark.common.domain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi,
Thanks for your contribution! It's a great improvement. However, from my perspective, there are a issue:
The common layer is a globally module where we strive to include common functionalities that are unrelated to specific business logic. Besides providing a data platform based on Spring Boot, StreamPark is also a stream processing development framework. We have provided some Flink|spark rapid development APIs, allowing users to independently leverage the capabilities of the development framework. Looking at it this way, it is not reasonable to place platform-specific logic such as HTTP status codes and backend exception message display in the common layer. These are not common capabilities, and they are not needed by the development framework.
I really like this improvement and I'm looking forward to your next submit. 😊 |
I will start reviewing this PR if no one reviews it |
In the current code, the backend still returns error messages to the frontend as before. The key issue is that these error messages are hard-coded and not processed through i18n. You can check out this issue. My suggestion is that after the backend detects an error, it should return a business state code, and the message info for each status code can be handled by the frontend. |
f2a669c
to
3df5ed5
Compare
@RocMarshal If you have time, can you help me with the review? Thank you. |
@RocMarshal @wolfboys I will replaced the hard-coded place in the project soon |
hi: |
[future] update AlertException ApiAlertException usage [future] Add prerequisite check utils [future] Add prerequisite check utils
[future] update AlertException ApiAlertException usage [future] Add prerequisite check utils [future] Add prerequisite check utils
b0f3de6
to
d8a420c
Compare
d8a420c
to
546a27e
Compare
+1 for me. Hi @zzzk1 Thank you for the pr and sorry for the late reply. How about
? I'd like to more ideas about it~ |
+1, This is a good idea |
What changes were proposed in this pull request
Issue Number: close #3007
Brief change log
Add a tool to unify pre-checking and throwing exceptions
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts