-
Notifications
You must be signed in to change notification settings - Fork 584
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
refactor(expr): introduce ExprError #3081
Conversation
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
@@ -96,6 +96,12 @@ pub enum ErrorCode { | |||
#[source] | |||
BoxedError, | |||
), | |||
#[error("Expr error: {0:?}")] | |||
ExprError( |
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.
I'm not sure should we introduce ExprError(ExprError)
here instead of convert to other RwError.
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.
pub type BoxedError = Box<dyn Error + Send + Sync>;
So there the error is boxed into a trait object. 🤔
ExprError(ExprError)
looks better to me.
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.
I think the expression error will always be capsulated by some other error like StreamError
when exposed to the user, so there might be no need to make it a variant of RwError
eventually.
We may keep it for now due to compatibility.
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.
pub type BoxedError = Box<dyn Error + Send + Sync>;
So there the error is boxed into a trait object. 🤔
ExprError(ExprError)
looks better to me.
It seems we can't refer ExprError
here due to crate dependencies?
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.
pub type BoxedError = Box<dyn Error + Send + Sync>;
So there the error is boxed into a trait object. 🤔
ExprError(ExprError)
looks better to me.It seems we can't refer
ExprError
here due to crate dependencies?
Yes, same as StorageError
Signed-off-by: TennyZhuang <[email protected]>
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.
LGTM!
Looking forward to it!
Codecov Report
@@ Coverage Diff @@
## main #3081 +/- ##
==========================================
+ Coverage 73.40% 73.46% +0.05%
==========================================
Files 734 735 +1
Lines 99959 99930 -29
==========================================
+ Hits 73376 73413 +37
+ Misses 26583 26517 -66
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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.
LGTM
@@ -96,6 +96,12 @@ pub enum ErrorCode { | |||
#[source] | |||
BoxedError, | |||
), | |||
#[error("Expr error: {0:?}")] | |||
ExprError( |
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.
pub type BoxedError = Box<dyn Error + Send + Sync>;
So there the error is boxed into a trait object. 🤔
ExprError(ExprError)
looks better to me.
Array( | ||
#[backtrace] | ||
#[source] | ||
RwError, |
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.
Will we refactor this later?
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.
Yes
@@ -256,7 +256,7 @@ mod tests { | |||
Arc::new(input.into()), | |||
&agg_type, | |||
return_type, | |||
ArrayBuilderImpl::Int32(I32ArrayBuilder::new(0)?), | |||
ArrayBuilderImpl::Int32(I32ArrayBuilder::new(0).unwrap()), |
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.
Why ArrayBuilder::new
returns Result
...
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.
Allocation may failed 😃
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.
Anyway, here it's unwrap
ed.
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.
Here is tests
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.
Cool!
@@ -96,6 +96,12 @@ pub enum ErrorCode { | |||
#[source] | |||
BoxedError, | |||
), | |||
#[error("Expr error: {0:?}")] | |||
ExprError( |
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.
I think the expression error will always be capsulated by some other error like StreamError
when exposed to the user, so there might be no need to make it a variant of RwError
eventually.
We may keep it for now due to compatibility.
#[backtrace] | ||
#[source] | ||
RwError, |
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.
May review this in the future. 🤣
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.
We need ArrayError :(
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang [email protected]
What's changed and what's your intention?
PLEASE DO NOT LEAVE THIS EMPTY !!!
As title
Checklist
./risedev check
(or alias,./risedev c
)Refer to a related PR or issue link (optional)
close #3082