Skip to content

Implement Eq/PartialEq for error types #645

Closed

Description

@spacebear21

Somewhat related to #403 as it'll allow testing against specific error variants without string matching.

Activity

  1. added
    enhancement
    good first issue
    on Apr 10, 2025
  2. w3irdrobot commented on May 30, 2025

    @w3irdrobot
    Contributor

    I can tackle this today if no one has picked it up

  3. spacebear21 commented on Jun 3, 2025

    @spacebear21
    CollaboratorAuthor

    Note: since we moved payjoin-ffi into this repo this issue now applies to the FFI wrapper types as well.

  4. w3irdrobot commented on Jun 3, 2025

    @w3irdrobot
    Contributor

    yeah I noticed the addition. I was working a little bit today.

  5. w3irdrobot commented on Jun 8, 2025

    @w3irdrobot
    Contributor

    @spacebear21 @DanGould i've run into a bit of a wall and am looking for advice on how to move forward. there is an ImplementationError that is a type alias for a boxed error. this type is used in many of the error enums we use throughout the library. partialeq and eq can't reliably be added to this type, making moving forward difficult. i can turn this alias into a generic struct. however, this generic will then end up infecting much more of the library. this boxed error seems to be a way around having to fully enumerate all error states. maybe the solution is to just add all the error states and remove this ImplementationError? so i'm not sure what the best way to proceed is. any suggestions?

  6. spacebear21 commented on Jun 8, 2025

    @spacebear21
    CollaboratorAuthor

    ImplementationError is a tricky one and may need to be tackled separately. I recently opened an issue here re: potentially changing it to an actual type. If you've made progress implementing Eq/PartialEq for the rest of the error types, feel free to open a PR for those and we can follow-up with ImplementationError after.

  7. DanGould commented on Jun 9, 2025

    @DanGould
    Member

    To support variants which encapsulate Implementation, it might work to implement PartialEq for ImplementationError that just always returns false. Not sure if we can do better than that.

  8. added a commit that references this issue on Jun 27, 2025
    909a5f3
  9. added a commit that references this issue on Jul 21, 2025
    0c1b931
  10. added a commit that references this issue on Sep 16, 2026
    c9630d1
  11. added a commit that references this issue on Sep 28, 2026
    9dbf27d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apienhancementgood first issuetech debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions