Skip to content
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

chore: tune return msg #2506

Merged
merged 10 commits into from
Sep 27, 2023

Conversation

shuiyisong
Copy link
Contributor

@shuiyisong shuiyisong commented Sep 27, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Now errors are divided into 2 kinds

  1. our handmade snafu error
  2. external error, like std::io::ERROR

we now return the source error's message to client (e.g: mysql client, http response, etc.)

  1. if source error is our snafu error, then {error} is returned, content of message should be #[snafu(display)]
  2. if source error contains an external error, then {error}: {external_err} is returned for detail explanation.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

This pr should hopefully be the last one for #1854.

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #2506 (37e2009) into develop (e352fb4) will decrease coverage by 0.36%.
Report is 3 commits behind head on develop.
The diff coverage is 85.41%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2506      +/-   ##
===========================================
- Coverage    85.25%   84.90%   -0.36%     
===========================================
  Files          729      729              
  Lines       115862   115914      +52     
===========================================
- Hits         98780    98414     -366     
- Misses       17082    17500     +418     

@shuiyisong shuiyisong added this pull request to the merge queue Sep 27, 2023
Merged via the queue into GreptimeTeam:develop with commit ee8d472 Sep 27, 2023
13 checks passed
@shuiyisong shuiyisong deleted the chore/tune_return_msg branch September 27, 2023 10:50
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* chore: test return msg

* fix: test_child_error

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* chore: fix test

* chore: minor fix grpc return value

* chore: format return msg

* chore: use root error as return value

* chore: fix empty err display

* chore: iter through external error

* chore: remove err msg

* chore: remove unused field

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants