matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

improve moerr to support mo-error's unified format and reporting

Open xzxiong opened this issue 3 years ago • 0 comments

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 handle moErrorCode->mysqlErrorCode mapping rules
  • define New(errorCoe, args) and NewWithContext(context.Context, errorCode, args) to handle error reporting
  • modify reference of moerr.ErrTxnClosed error, as an example of moerr.New(...)
  • predefine Group 6: sql error as sql error, which normally can be converted to mysql error code.

xzxiong avatar Aug 12 '22 10:08 xzxiong