Our errors are getting out of hand and we need to do something to reduce the number of variants. Many can be grouped and details specified at runtime. As an example, we could turn this:
#[error("unexpected code error: {0}")]
UnexpectedCode(String),
#[error("unexpected count code error: {0}")]
UnexpectedCountCode(String),
#[error("unexpected op code error: {0}")]
UnexpectedOpCode(String),
into
#[error("unexpected code error: {0}")]
UnexpectedCode(String),
And simply specify the op and count information in the supplied string.
Our errors are getting out of hand and we need to do something to reduce the number of variants. Many can be grouped and details specified at runtime. As an example, we could turn this:
into
And simply specify the op and count information in the supplied string.