Skip to content

Conversation

@srxg
Copy link

@srxg srxg commented Jun 1, 2025

Restructured ErrorKind into FundamentalError, ValidationError, and ThirdPartyError enums.

@Keats
Copy link
Owner

Keats commented Sep 29, 2025

That doesn't look like it would change much for the user?

@dsykes16
Copy link
Contributor

dsykes16 commented Oct 9, 2025

This would be a breaking change for most dependents of this crate and I also don't see how it changes anything aside from making error handling code on the consumer side even more verbose.

@Keats Keats closed this Oct 9, 2025
@srxg
Copy link
Author

srxg commented Nov 12, 2025

@dsykes16 @Keats

I also don't see how it changes anything aside from making error handling code on the consumer side even more verbose.
That doesn't look like it would change much for the user?

The goal was to make it trivial to answer a very common question: "was this failure a validation error or something else?". That's important for downstream behaviour.

This would be a breaking change for most dependents of this crate

To avoid breakage and extra verbosity, I'm happy to rework this as an additive API, potentially in the below example's direction:

pub enum ErrorCategory { Fundamental, Validation, ThirdParty } impl ErrorKind { pub fn category(&self) -> ErrorCategory { todo!() } pub fn is_validation(&self) -> bool { matches!(self.category(), ErrorCategory::Validation) } } impl Error { pub fn category(&self) -> ErrorCategory { self.kind().category() } }

this addresses both concerns: api for a valid need, with minimal surface change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants