incubator-streampark
incubator-streampark copied to clipboard
[WIP][ISSUE-3007][Improve] Introduce a premise utils to reduce conditions check and exceptions processing
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:
- Added Test to verify the change.
Does this pull request potentially affect one of the following parts
- Dependencies (does it add or upgrade a dependency): (no)
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.
@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: There are some conflicts that need to be resolved first
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.
+1 for me.
Hi @zzzk1 Thank you for the pr and sorry for the late reply. thx for @wolfboys @caicancai comments.
How about
- Only introduce a separate
XXXUtils
in console-service to perform a check with built-in exception binding - And keep common related checks in
Utils
.
?
I'd like to more ideas about 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.
+1 for me.
Hi @zzzk1 Thank you for the pr and sorry for the late reply. thx for @wolfboys @caicancai comments.
How about
- Only introduce a separate
XXXUtils
in console-service to perform a check with built-in exception binding- And keep common related checks in
Utils
.?
I'd like to more ideas about it~
- Only introduce a separate XXXUtils in console-service to perform a check with built-in exception binding
- And keep common related checks in Utils.
+1, This is a good idea