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

Make error message for certs not found in user table clearer #530

Merged
merged 5 commits into from
Nov 7, 2019

Conversation

achamayou
Copy link
Member

fix #525

@achamayou achamayou requested a review from a team as a code owner November 6, 2019 13:39
@@ -503,7 +503,7 @@ namespace ccf
jsonrpc::error_response(
0,
jsonrpc::CCFErrorCodes::INVALID_CALLER_ID,
"No corresponding caller entry exists."),
"Could not find matching user certificate."),
Copy link
Member

Choose a reason for hiding this comment

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

This is also called by members, where this error is incorrect. We could use callers->get_name(), but I think that will be ccf.user_certs?

Copy link
Member Author

Choose a reason for hiding this comment

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

actor certificate?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe overkill, but as a general solution:

frontend.h:

virtual std::string invalid_caller_error_message() const {
  return "Could not find matching actor certificate";
}

memberfrontend.h:

std::string invalid_caller_error_message() const override {
  return "Could not find matching member certificate";
}

etc

@codecov-io
Copy link

codecov-io commented Nov 6, 2019

Codecov Report

Merging #530 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #530      +/-   ##
==========================================
+ Coverage   78.12%   78.12%   +<.01%     
==========================================
  Files         140      140              
  Lines       10473    10475       +2     
==========================================
+ Hits         8181     8183       +2     
  Misses       2292     2292
Flag Coverage Δ
#e2e_BFT 51.31% <0%> (+0.22%) ⬆️
#e2e_CFT 72.37% <0%> (-0.02%) ⬇️
#unit_BFT 65.11% <ø> (ø) ⬆️
#unit_CFT 72.28% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
src/node/rpc/frontend.h 77.88% <100%> (+0.05%) ⬆️
src/node/rpc/memberfrontend.h 82.54% <100%> (+0.05%) ⬆️

@ghost
Copy link

ghost commented Nov 6, 2019

images

@ghost
Copy link

ghost commented Nov 6, 2019

images

@ghost
Copy link

ghost commented Nov 6, 2019

images

@ghost
Copy link

ghost commented Nov 7, 2019

images

@achamayou achamayou merged commit d106f9d into master Nov 7, 2019
@achamayou achamayou deleted the clearer_error_msg branch November 7, 2019 09:12
eddyashton pushed a commit to eddyashton/CCF that referenced this pull request Mar 24, 2020
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.

Error message for unknown cert is confusing
4 participants