Skip to content

Restore HTTP.Exceptions as a deprecating compat shim + migration note#1315

Open
mathieu17g wants to merge 1 commit into
JuliaWeb:masterfrom
mathieu17g:fix/exceptions-submodule-shim
Open

Restore HTTP.Exceptions as a deprecating compat shim + migration note#1315
mathieu17g wants to merge 1 commit into
JuliaWeb:masterfrom
mathieu17g:fix/exceptions-submodule-shim

Conversation

@mathieu17g

Copy link
Copy Markdown
Contributor

Implements the deprecating HTTP.Exceptions shim and migration note discussed in #1314 (context and prevalence there).

src/HTTP.jl re-adds HTTP.Exceptions as a thin deprecated submodule forwarding the four relocated types to their top-level names:

module Exceptions
    import ..HTTP
    Base.@deprecate_binding HTTPError    HTTP.HTTPError    false
    Base.@deprecate_binding StatusError  HTTP.StatusError  false
    Base.@deprecate_binding ConnectError HTTP.ConnectError false
    Base.@deprecate_binding TimeoutError HTTP.TimeoutError false
end

So catch … isa HTTP.Exceptions.StatusError resolves again, forwarding to HTTP.StatusError with a --depwarn=yes warning — same mechanism as the existing @deprecate escape escapeuri, and like it, untested.

RequestError, @try, and current_exceptions_to_string are not reinstated; the migration note covers them (RequestError has no drop-in — the underlying exception propagates and isrecoverable classifies it, #1310).

docs/src/guides/migration-1x.md gains an "Exceptions" section (Before/After for StatusError and RequestError) and a Final-Checklist line.

Closes #1314.

Re-add HTTP.Exceptions as a thin deprecated submodule forwarding HTTPError,
StatusError, ConnectError and TimeoutError to the canonical top-level names via
Base.@deprecate_binding (as the existing escape -> escapeuri), so downstream
`catch ... isa HTTP.Exceptions.StatusError` keeps working with a deprecation
warning. RequestError, @Try and current_exceptions_to_string are not reinstated;
the migration guide documents them (RequestError has no drop-in -- the underlying
exception propagates and isrecoverable classifies it).

Closes JuliaWeb#1314.
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.17%. Comparing base (9e830d9) to head (2e44ce5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1315      +/-   ##
==========================================
- Coverage   87.32%   87.17%   -0.16%     
==========================================
  Files          29       29              
  Lines       11326    11326              
==========================================
- Hits         9890     9873      -17     
- Misses       1436     1453      +17     

☔ View full report in Codecov by Harness.
📢 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.

@mathieu17g

Copy link
Copy Markdown
Contributor Author

The codecov/project -0.16% is an indirect drop in http2_server.jl's non-deterministic error/RST paths (base 10 coverage sessions vs this PR's 5; codecov/patch green; this PR's files untracked) — a re-run should re-aggregate and clear it.

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.

HTTP.Exceptions submodule removed in 2.x — restore as a (deprecating) compat shim, or document it?

1 participant