Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Make RichReason generic over custom error type#962

Merged
zesterer merged 1 commit into
zesterer:mainfrom
icewind1991:generic-rich-custom
Feb 19, 2026
Merged

Make RichReason generic over custom error type#962
zesterer merged 1 commit into
zesterer:mainfrom
icewind1991:generic-rich-custom

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

Fixes #959

Makes it easier to provide richer customer errors without having to re-implement parts of Rich.

A lot of uses should be compatible, but any code that pattern matches on RichReason might need updates, and Rich::custom changed from taking an ToString to an Into<String> by default which isn't always compatible.

The second incompatibility case could be solved by only having Rich::custom be implemented for Rich<_, _, String> and have a different method for the generic version if desired.

@zesterer

Copy link
Copy Markdown
Owner

Thanks! I can't see anything wrong with this PR, much appreciated.

@zesterer
zesterer merged commit 3a4bc57 into zesterer:main Feb 19, 2026
4 checks passed
@icewind1991
icewind1991 deleted the generic-rich-custom branch February 21, 2026 18:40
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.

Make RichReason generic over custom error type.

2 participants