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

feat(rpc): handle exceptions by returning a proto and non-200 #6402

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

colin-sentry
Copy link
Member

@colin-sentry colin-sentry requested review from a team as code owners October 9, 2024 19:16
Copy link

codecov bot commented Oct 9, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2625 1 2624 5
View the top 1 failed tests by shortest run time
tests.web.rpc.test_run_rpc_handler test_rpc_handler_bad_request
Stack Traces | 0.002s run time
Traceback (most recent call last):
  File ".../web/rpc/test_run_rpc_handler.py", line 13, in test_rpc_handler_bad_request
    assert err.message == "blah"
AssertionError: assert ('protobuf gave a decode error Error parsing message (are all fields set and '\n 'the correct types?)') == 'blah'
  - blah
  + protobuf gave a decode error Error parsing message (are all fields set and the correct types?)

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

snuba/web/views.py Outdated Show resolved Hide resolved
@colin-sentry colin-sentry merged commit 3c7e451 into master Oct 10, 2024
30 checks passed
@colin-sentry colin-sentry deleted the proto_errors branch October 10, 2024 20:02
volokluev added a commit that referenced this pull request Oct 11, 2024
In #6402 I asked to put as [little of the error handling logic into the
flask layer as
possible](#6402 (comment))
but it went too far in the other direction and bled the flask object
into the RPC code (which was not the intention).

This PR removes the flask `Response` object out of the RPC code
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.

2 participants