Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

error_message: more friendly error message #771

Merged
merged 17 commits into from
Jul 8, 2020

Conversation

GMHDBJD
Copy link
Collaborator

@GMHDBJD GMHDBJD commented Jun 30, 2020

What problem does this PR solve?

  • use TError to replace ProcessError
     "errors": [
                              {
                                  "msg": "",
                                  "error": {
                                      "ErrCode": 10006,
                                      "ErrClass": 1,
                                      "ErrScope": 2,
                                      "ErrLevel": 3,
                                      "Message": "this is the error message",
                                      "RawCause": "this is the raw cause",
                                      "Workaround": "this is the workaround"
                                  }
                              }
             ]
    
    will become
    "errors": [
                              {
                                  "ErrCode": 10006,
                                  "ErrClass": "database",
                                  "ErrScope": "downstream",
                                  "ErrLevel": "high",
                                  "Message": "this is the error message",
                                  "RawCause": "this is the raw cause",
                                  "Workaround": "this is the workaround"
                              }
            ]
    
  • only show error message, rawcause, workaround which is not nil
    [code=10001:class=database:scope=not-set:level=high], Message: database driver error, RawCause: 'tidb_retry_limit' can't be set to the value, Workaround: Please check your database config
    
    [code=48001:class=not-set:scope=not-set:level=high]
    

What is changed and how it works?

  • update ProcessError proto
  • add ErrNotSet, use for unknow error
  • better error message format

@GMHDBJD GMHDBJD added priority/normal Minor change, requires approval from ≥1 primary reviewer status/PTAL This PR is ready for review. Add this label back after committing new changes status/WIP This PR is still work in progress and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jun 30, 2020
@GMHDBJD GMHDBJD changed the title error_message: replace ProcessError with TError error_message: more friendly error message Jul 1, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jul 1, 2020

/run-all-tests

1 similar comment
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jul 1, 2020

/run-all-tests

@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #771 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master       #771   +/-   ##
===========================================
  Coverage   57.1281%   57.1281%           
===========================================
  Files           206        206           
  Lines         21352      21352           
===========================================
  Hits          12198      12198           
  Misses         7964       7964           
  Partials       1190       1190           

@GMHDBJD GMHDBJD added status/PTAL This PR is ready for review. Add this label back after committing new changes needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 and removed status/WIP This PR is still work in progress labels Jul 1, 2020
@GMHDBJD GMHDBJD mentioned this pull request Jul 2, 2020
13 tasks
@GMHDBJD GMHDBJD added this to Review in progress in Usability Improvement Jul 2, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jul 6, 2020

/run-all-tests

Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

rest LGTM

_utils/terror_gen/checker_template.go Outdated Show resolved Hide resolved
@WangXiangUSTC
Copy link
Contributor

LGTM

@ti-srebot
Copy link

@WangXiangUSTC,Thanks for your review.

@ti-srebot ti-srebot added the status/LGT1 One reviewer already commented LGTM label Jul 6, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jul 7, 2020

/run-all-tests

Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest LGTM

tests/dmctl_basic/check_list/check_task.sh Outdated Show resolved Hide resolved
pkg/terror/error_list.go Show resolved Hide resolved
Usability Improvement automation moved this from Review in progress to Reviewer approved Jul 7, 2020
Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

LGTM

@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jul 7, 2020

/run-all-tests

1 similar comment
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jul 8, 2020

/run-all-tests

@GMHDBJD GMHDBJD added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Jul 8, 2020
@GMHDBJD GMHDBJD merged commit 4338965 into pingcap:master Jul 8, 2020
Usability Improvement automation moved this from Reviewer approved to Done Jul 8, 2020
@GMHDBJD GMHDBJD deleted the replaceProcessErrorWithTError branch July 8, 2020 04:51
@ti-srebot
Copy link

cherry pick to release-1.0 failed

@csuzhangxc csuzhangxc added this to the v2.0.0 RC milestone Jul 15, 2020
@csuzhangxc csuzhangxc added the needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated label Jul 15, 2020
@lance6716 lance6716 moved this from Done to Reviewer approved in Usability Improvement Jul 16, 2020
@lance6716 lance6716 added already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jul 17, 2020
@GMHDBJD GMHDBJD removed the needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated label Aug 13, 2020
@lance6716 lance6716 moved this from Reviewer approved to Done in Usability Improvement Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants