Skip to content

Comments

[ty] Improve concise diagnostics for invalid exceptions when a user catches a tuple of objects#21578

Merged
AlexWaygood merged 1 commit intomainfrom
alex/exception-concise-diagnostic
Nov 22, 2025
Merged

[ty] Improve concise diagnostics for invalid exceptions when a user catches a tuple of objects#21578
AlexWaygood merged 1 commit intomainfrom
alex/exception-concise-diagnostic

Conversation

@AlexWaygood
Copy link
Member

Summary

The concise diagnostic is currently just "Invalid tuple caught in an exception handler", which doesn't give the user sufficient information to debug the problem

Test Plan

Manual testing, since we don't currently have any tests for concise diagnostics:

image

@AlexWaygood AlexWaygood added ty Multi-file analysis & type inference diagnostics Related to reporting of diagnostics. labels Nov 22, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 22, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 22, 2025

mypy_primer results

Changes were detected when running on open source projects
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ src/scikit_build_core/build/wheel.py:98:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 44 diagnostics
+ Found 45 diagnostics

No memory usage changes detected ✅

@AlexWaygood AlexWaygood marked this pull request as ready for review November 22, 2025 13:46
@AlexWaygood AlexWaygood merged commit f2ce5e5 into main Nov 22, 2025
42 checks passed
@AlexWaygood AlexWaygood deleted the alex/exception-concise-diagnostic branch November 22, 2025 13:46
@sharkdp
Copy link
Contributor

sharkdp commented Nov 24, 2025

Manual testing, since we don't currently have any tests for concise diagnostics:

Mdtests?

@AlexWaygood
Copy link
Member Author

Manual testing, since we don't currently have any tests for concise diagnostics:

Mdtests?

Oh, right, of course! They're a bit of a pain to update if you assert on the error message, though

dcreager added a commit that referenced this pull request Nov 24, 2025
* origin/main: (27 commits)
  [ty] Add hint about resolved Python version when a user attempts to import a member added on a newer version (#21615)
  Use release commit for actions/checkout (#21610)
  [ty] Add failing mdtest for known `Protocol` panic (#21594)
  [`parser`] Fix panic when parsing IPython escape command expressions (#21480)
  Fix cargo shear in CI (#21609)
  Update actions/checkout digest to c2d88d3 (#21601)
  Update dependency ruff to v0.14.6 (#21603)
  Update astral-sh/setup-uv action to v7.1.4 (#21602)
  Update Rust crate clap to v4.5.53 (#21604)
  Update taiki-e/install-action action to v2.62.56 (#21608)
  Update Rust crate hashbrown to v0.16.1 (#21605)
  Update Rust crate indexmap to v2.12.1 (#21606)
  Update Rust crate syn to v2.0.111 (#21607)
  [ty] Check method definitions on subclasses for Liskov violations (#21436)
  [ty] Fix panic for unclosed string literal in type annotation position (#21592)
  [ty] Fix rendering of unused suppression diagnostic (#21580)
  [ty] Improve lsp handling of hover/goto on imports (#21572)
  [ty] Improve diagnostics when a submodule is not available as an attribute on a module-literal type (#21561)
  [ty] Improve concise diagnostics for invalid exceptions when a user catches a tuple of objects (#21578)
  [ty] upgrade salsa (#21575)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Related to reporting of diagnostics. ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants