Skip to content
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

[Improve][Core][Exceptiom Management] Add Exception Management API & Unified Exception in API Module #3045

Merged
merged 9 commits into from
Nov 14, 2022

Conversation

TyrantLucifer
Copy link
Member

Purpose of this pull request

close #3043

Check list

EricJoy2048
EricJoy2048 previously approved these changes Oct 10, 2022
Copy link
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hisoka-X
Copy link
Member

I have a different point of view, why don't we directly inherit SeaTunnelException to implement different types of Exception, but use enumeration to determine the Exception type? What is the use of Code for users? And it is impossible to manage all Exception through CommonErrorCode, and some Exceptions will use CommonErrorCode, and some will not be used.

@TyrantLucifer
Copy link
Member Author

I have a different point of view, why don't we directly inherit SeaTunnelException to implement different types of Exception, but use enumeration to determine the Exception type? What is the use of Code for users? And it is impossible to manage all Exception through CommonErrorCode, and some Exceptions will use CommonErrorCode, and some will not be used.

Every connector will implement their own codes. Unified exception make error message more clearly. If we directly inherit SeaTunnelException, for all modules need create more and more exceptions. This is a good practice reference from datax.

@liugddx
Copy link
Member

liugddx commented Oct 11, 2022

I have a different point of view, why don't we directly inherit SeaTunnelException to implement different types of Exception, but use enumeration to determine the Exception type? What is the use of Code for users? And it is impossible to manage all Exception through CommonErrorCode, and some Exceptions will use CommonErrorCode, and some will not be used.

+1. It's better to use a different implementation.

@TyrantLucifer
Copy link
Member Author

I have a different point of view, why don't we directly inherit SeaTunnelException to implement different types of Exception, but use enumeration to determine the Exception type? What is the use of Code for users? And it is impossible to manage all Exception through CommonErrorCode, and some Exceptions will use CommonErrorCode, and some will not be used.

+1. It's better to use a different implementation.

So if a connector has more than 10 types exceptions, do we need define more than 10 classes to display those? It's not a good option. More More fine-grained exception I want to show what should I do?

@liugddx
Copy link
Member

liugddx commented Oct 11, 2022

Can it be like Flink? All Connector uses FlinkRuntimeexception and definition for detailed mistakes.

@EricJoy2048
Copy link
Member

I have a different point of view, why don't we directly inherit SeaTunnelException to implement different types of Exception, but use enumeration to determine the Exception type? What is the use of Code for users? And it is impossible to manage all Exception through CommonErrorCode, and some Exceptions will use CommonErrorCode, and some will not be used.

+1. It's better to use a different implementation.

So if a connector has more than 10 types exceptions, do we need define more than 10 classes to display those? It's not a good option. More More fine-grained exception I want to show what should I do?

That's what I'm worried about.

@TyrantLucifer TyrantLucifer force-pushed the unified-exception branch 2 times, most recently from 3612043 to 8fd4dec Compare October 13, 2022 15:25
@TyrantLucifer TyrantLucifer changed the title [Improve][Core][Exceptiom Management] Add Exception Management API [Improve][Core][Exceptiom Management] Add Exception Management API & Unified Exception in API Module Oct 13, 2022
@TyrantLucifer
Copy link
Member Author

@ashulin @Hisoka-X @EricJoy2048 @CalvinKirs @hailin0 Please review and give some suggestions. Thx

@EricJoy2048
Copy link
Member

Hi, all. What is our conclusion? I agree with @TyrantLucifer , The exception handling of http-server <-> app-client is also the result of continuous optimization and iteration, and I think their design is very good for user experience. ErrorCode can simple help user to understand what happened in the system. On the other hand, ErrorCode can reduce randomly defined exceptions.

Especially when we need to collect error data in the future, ErrorCode can be stored in the error data together with the data. When we display the cause of the error in the web page, the ErrorCode can obtain the details of the exception, which is very helpful for the analysis of error data.

@TyrantLucifer TyrantLucifer requested review from hailin0, Hisoka-X and EricJoy2048 and removed request for hailin0 November 10, 2022 08:19
Copy link
Contributor

@TaoZex TaoZex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@531651225 531651225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@ic4y ic4y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@TyrantLucifer TyrantLucifer merged commit d82f8fa into apache:dev Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improve][Core][Exceptiom Management] Design Exception Management API
8 participants