Skip to content

Add formatter for std::exception_ptr#4837

Closed
avikivity wants to merge 1 commit into
fmtlib:mainfrom
avikivity:exception-ptr
Closed

Add formatter for std::exception_ptr#4837
avikivity wants to merge 1 commit into
fmtlib:mainfrom
avikivity:exception-ptr

Conversation

@avikivity

@avikivity avikivity commented Jul 5, 2026

Copy link
Copy Markdown

The formatter prints std::exception::what() (if that's what the
exception is) and prints the type name for exceptions
that are not derived from std::exception.

Fixes #4808

@avikivity avikivity requested a review from vitaut as a code owner July 5, 2026 12:17
@phprus

phprus commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

It makes sense to reuse formatter<std::exception> format behavior:
#4819 (comment)

The formatter prints std::exception::what() (if that's what the
exception is) and prints the type name for exceptions
that are not derived from std::exception.

Fixes fmtlib#4808
@avikivity

Copy link
Copy Markdown
Author

Update:

  • rebase
  • add comment in api.md
  • reuse formatter<std::exception>

@vitaut

vitaut commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR but the std::exception_ptr formatter has already been added in #4819. If you would like to propose any extra functionality please build on top of that.

@vitaut vitaut closed this Jul 5, 2026
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.

Formatting std::exception_ptr:s

3 participants