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

When the context of a request is nil, return InvalidArgument/400 #2377

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

dmjb
Copy link
Contributor

@dmjb dmjb commented Feb 19, 2024

Fixes #2376

When the context of a request is missing, return a user-visible "InvalidArgument" response. Previously, this returned a regular Go error which caused the GRPC server to return a 500 response to the client.

When the context of a request is missing, return a user-visible
"InvalidRequest" response. Previously, this returned a regular Go error
which caused the GRPC server to return a 500 response to the client.
@dmjb dmjb requested a review from a team as a code owner February 19, 2024 15:53
@dmjb dmjb changed the title Fixes #2376 When the context of a request is nil, return InvalidArgument/400 Feb 19, 2024
@coveralls
Copy link

coveralls commented Feb 19, 2024

Coverage Status

coverage: 35.779% (+0.01%) from 35.767%
when pulling 027ebfe on issue-2376/nil-context-status-code
into 0be4d6f on main.

@JAORMX
Copy link
Contributor

JAORMX commented Feb 19, 2024

Seems golangci-lint is not happy. might wanna fix that. We also don't allow it to properly comment on the PR... this should fix it #2378

@dmjb dmjb merged commit 0fea09a into main Feb 19, 2024
6 checks passed
@dmjb dmjb deleted the issue-2376/nil-context-status-code branch February 19, 2024 16:38
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.

If no Context is provided, minder returns a 500, 400 might be more appropriate
4 participants