-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: using standard error to replace terror #19425
Conversation
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.
@imtbkcat please fix ci.
424337b
to
6bd9443
Compare
@@ -414,8 +415,8 @@ func convertJob2RollbackJob(w *worker, d *ddlCtx, t *meta.Meta, job *model.Job) | |||
job.Error = toTError(err) | |||
} | |||
if !job.Error.Equal(errCancelledDDLJob) { | |||
job.Error = job.Error.Class().Synthesize(job.Error.Code(), | |||
fmt.Sprintf("DDL job rollback, error msg: %s", job.Error.ToSQLError().Message)) | |||
job.Error = terror.GetErrClass(job.Error).Synthesize(terror.ErrCode(job.Error.Code()), |
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.
Can we use errors.Annotatef
here directly? @wjhuang2016
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 job.Error
should be a terror.Errors
type, but errors.Annotatef
will produce an error
type.
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.
Don't forget to change the parser dependence in the go.mod.
PTAL @bb7133 @cfzjywxk @SunRunAway |
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
This pr can not update parser now, because of #19709 cause CI fail |
/run-all-tests |
1 similar comment
/run-all-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.
LGTM
/run-all-tests |
/merge |
@imtbkcat Oops! This PR requires at least 2 LGTMs to merge. The current number of |
/run-all-tests |
/run-unit-test |
1 similar comment
/run-unit-test |
/run-unit-test |
/run-cherry-picker |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #19888 |
/run-cherry-picker |
What problem does this PR solve?
Problem Summary: Replace error in tidb with standard error. parser pr is: pingcap/parser#982
What is changed and how it works?
Proposal: Standardize error codes and messages
What's Changed:
Change error message in test cases.
How it Works:
Error message changed after
terror.Error
has been replaced witherrors.Error
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note
replace error code and message with standard error.