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
introduced error cases to supress case_clause errors because of bifrost delayed response. #3408
Conversation
✅ Deploy Preview for chef-server ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
cdbf6d1
to
9912317
Compare
LGTM. Nice work @sreepuramsudheer |
Thanks for getting the additional error reporting started. Could you please look at the verify test currently failing? |
@@ -328,7 +329,9 @@ is_authorized_on_resource(RequestorId, ResourceType, ResourceId, ActorType, Acto | |||
%% This api returns not found for any missing permission | |||
{error, not_found} -> false; | |||
%% Otherwise, we expect server_error; not forbidden | |||
{error, server_error} -> {error, server_error} | |||
{error, server_error} -> {error, server_error}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change this to have any other error tuple returned as-is, eg {error, Any} -> {error, Any}
; the shape of the tuple is more important to capture than each individual possible error type.
@@ -123,6 +123,7 @@ create_entity_if_authorized(Context, OrgId, CreatorAId, ObjectType) -> | |||
{error, forbidden}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still fail with a 500 in case of a non-forbidden error return, which I think is correct - but it does mean that we'll potentially lose logging/error info here. Let's create a new issue to confirm & fix that if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I think it would be useful to add the matcher for the {error, Error} case from
{error, Error} -> {error, Error} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That error would also need to propogate all the way up through
case oc_chef_authz:create_entity_if_authorized(AuthzCtx, OrgId, superuser, Type) of |
Result = oc_chef_authz:create_entity_if_authorized(Context#context.authz_context, |
case oc_chef_authz:create_entity_if_authorized(AuthzContext, OrgId, |
9912317
to
170469a
Compare
We can merge after rebase |
…st delayed response. Signed-off-by: sreepuramsudheer <ssudheer@progress.com>
170469a
to
f42b51b
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
Code changes to solve issue raised #1896.
Issues Resolved
(#1896)
Check List