Skip to content

Conversation

@aaronrosenthal
Copy link
Contributor

Include both type and message when inheriting field-level errors.

This can be useful in situations where we might want to query the errors without having to consider the full message. For example:

begin
  ::SignupOp.submit!(email: nil)
rescue Subroutine::Failure => e
  if e.record.errors.added?(:email, :blank)
    # some special handling of the error here...
  end
end

@mnelson mnelson merged commit 1f90562 into main May 14, 2025
3 checks passed
@mnelson mnelson deleted the inherit-error-type branch May 14, 2025 13:43
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.

3 participants