Skip to content

Conversation

@jacktengg
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Problem Summary:

Failure message for BE http api does not show detail status code:

    "status": "Fail",
    "msg": ""
}

Improved to:

{
    "status": "Not found",
    "msg": "Tablet not found. tablet_id=1202"
}

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

writer.StartObject();
// status
writer.Key("status");
if (status.ok()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi jack, I think we could move to_json(Status& status) method to common/status.h since there is only one method in this file and it is related with common/status.
And also you could remove json_util_test.h because we could not ensure that the error message always the same with the expected string.

@jacktengg jacktengg force-pushed the improve_status_code branch from 7543d53 to 00d7685 Compare May 26, 2022 03:18
Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

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

LGTM

@yiguolei yiguolei merged commit 9236c2e into apache:master May 26, 2022
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label May 26, 2022
@yiguolei yiguolei added the dev/backlog waiting to be merged in future dev branch label May 26, 2022
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman morningman mentioned this pull request Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/backlog waiting to be merged in future dev branch reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants