Skip to content

♻️ Create exceptions module and TyperException base class - #1942

Merged
tiangolo merged 2 commits into
fastapi:masterfrom
svlandeg:feat/typer_exception
Aug 28, 2026
Merged

♻️ Create exceptions module and TyperException base class#1942
tiangolo merged 2 commits into
fastapi:masterfrom
svlandeg:feat/typer_exception

Conversation

@svlandeg

@svlandeg svlandeg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Pull Request

Discussion: #1832

Description

Continuing from the original Click vendoring, this PR introduces a new base class TyperException that all other exception classes inherit from. This is to replace a check for ClickException (which some users may want to do, cf discusssion thread) which is currently in the private module _click and shouldn't be used/imported directly. The "old" Click exception hierarchy will be refactored in the near future and shouldn't be used directly either.

Abort and Exit have always been part of the public Typer API and as such they are moved into the new Typer module.

AI Disclaimer

No AI used, just good old fashioned human communication & thinking. Refreshing 😎

Checklist

  • This PR links to a GitHub Discussion for the proposed code change.
  • Coverage stays at 100%.
  • The documentation explains the change if needed.

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you! 🚀

This will be available in Typer 0.27.2 in the next few hours.

@tiangolo
tiangolo merged commit 41dea8f into fastapi:master Aug 28, 2026
23 checks passed
@svlandeg
svlandeg deleted the feat/typer_exception branch August 28, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants