matrixone
matrixone copied to clipboard
improve moerr to support mo-error's unified format and reporting
What type of PR is this?
- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [x] Feature
- [ ] Test and CI
- [ ] Code Refactoring
Which issue(s) this PR fixes:
issue #3435,
What this PR does / why we need it:
mo has its own error code/message, and need to adapt mysql error code.
- define
moErrorMsgItem{errorCode, mysqlErrorCode, errorMsgOrFormat}to handlemoErrorCode->mysqlErrorCodemapping rules - define
New(errorCoe, args)andNewWithContext(context.Context, errorCode, args)to handle error reporting - modify reference of
moerr.ErrTxnClosederror, as an example ofmoerr.New(...) - predefine
Group 6: sql erroras sql error, which normally can be converted to mysql error code.