Skip to content

Check HTTP status before parsing response body#673

Merged
miparnisari merged 1 commit intoauthzed:mainfrom
ivanauth:fix/issue-671-http-error-handling
Apr 20, 2026
Merged

Check HTTP status before parsing response body#673
miparnisari merged 1 commit intoauthzed:mainfrom
ivanauth:fix/issue-671-http-error-handling

Conversation

@ivanauth
Copy link
Copy Markdown
Contributor

Summary

  • When zed validate fetches a URL that returns a non-200 response (e.g. 404), the error page was fed to the schema parser, producing a confusing "invalid yaml" error
  • Now checks HTTP status code first and returns a clear error like failed to fetch ...: received HTTP 404
  • Strips query params from the error URL to avoid leaking tokens

Closes #671

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.24%. Comparing base (cd9c974) to head (fd35483).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #673      +/-   ##
==========================================
+ Coverage   43.19%   43.24%   +0.04%     
==========================================
  Files          38       38              
  Lines        6035     6040       +5     
==========================================
+ Hits         2607     2612       +5     
  Misses       3163     3163              
  Partials      265      265              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ivanauth ivanauth force-pushed the fix/issue-671-http-error-handling branch from 6d777b5 to fd35483 Compare April 17, 2026 17:44
@miparnisari miparnisari force-pushed the fix/issue-671-http-error-handling branch from fd35483 to bbebb7b Compare April 20, 2026 20:17
@miparnisari miparnisari enabled auto-merge (squash) April 20, 2026 20:21
@miparnisari miparnisari merged commit 66bcb81 into authzed:main Apr 20, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add error handling to HTTP fetching of validation files

3 participants