Skip to content

fix(wizard): Improve API responses from wizard API route #93787

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

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented Jun 18, 2025

This used to return a HTML page with weird content (e.g. spotlight stuff, ...) which lead to failures. Possibly this is just in local dev, but still. Now, this returns proper JSON that the frontend can also possibly use for better error messages etc.

Importantly, this used to fail from the frontends perspective even for HttpResponse(status=200) because it included some weird HTML that it was apparently not expecting. By returning JSON this should be fixed. (I think this is only on dev because of spotlight...)

Noticed this while working on #93697

This used to return a HTML page with weird content (e.g. spotlight stuff, ...) which lead to failures. Possibly this is just in local dev, but still. Now, this returns proper JSON that the frontend can also possibly use for better error messages etc.
@mydea mydea self-assigned this Jun 18, 2025
@mydea mydea requested a review from a team as a code owner June 18, 2025 07:28
@mydea mydea requested review from stephanie-anderson and AbhiPrasad and removed request for a team June 18, 2025 07:28
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 18, 2025
@mydea mydea changed the title feat(wizard): Improve error responses from wizard API route fix(wizard): Improve API responses from wizard API route Jun 18, 2025
mydea added a commit that referenced this pull request Jun 18, 2025
I noticed that the error messages are not displayed at all right now, I
guess because the `Indicators` have been missing. So I added this, and
while at it also added some more specific error message for the case
when no active DSN can be found in the project.

The DSN error is based on changed here:
#93787 but this PR should work
unrelated to that still (it will just never show this message).
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/web/frontend/setup_wizard.py 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #93787      +/-   ##
==========================================
- Coverage   88.02%   88.02%   -0.01%     
==========================================
  Files       10332    10332              
  Lines      596302   596305       +3     
  Branches    23163    23163              
==========================================
- Hits       524911   524904       -7     
- Misses      70935    70945      +10     
  Partials      456      456              

@mydea mydea merged commit dd4eaca into master Jun 18, 2025
68 of 69 checks passed
@mydea mydea deleted the fn/better-wizard-error-handling branch June 18, 2025 08:14
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
I noticed that the error messages are not displayed at all right now, I
guess because the `Indicators` have been missing. So I added this, and
while at it also added some more specific error message for the case
when no active DSN can be found in the project.

The DSN error is based on changed here:
#93787 but this PR should work
unrelated to that still (it will just never show this message).
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
This used to return a HTML page with weird content (e.g. spotlight
stuff, ...) which lead to failures. Possibly this is just in local dev,
but still. Now, this returns proper JSON that the frontend can also
possibly use for better error messages etc.

Importantly, this used to fail from the frontends perspective even for
`HttpResponse(status=200)` because it included some weird HTML that it
was apparently not expecting. By returning JSON this should be fixed. (I
_think_ this is only on dev because of spotlight...)

Noticed this while working on
#93697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants