Skip to content

Bug with how AcceptedError is handled #1022

@xibz

Description

@xibz

Computing stats, ListContributorsStats, will return an AcceptedError and a body that is a JSON object and not a JSON array. However, it seems this will try to decode it as a JSON array causing a serialization error.

Commit that caused the bug... this seems to be a breaking change as well; I guess it is now obvious that it is:
88eb4e9

My suggestion would be to internally type alias the []ContributorStats and add a ImmediateAcceptedErrorReturn interface that can be casted during the client.Do function. If it is castable to an ImmediateAcceptedErrorReturn, it will immediately return the AcceptedError and not try to unmarshal the body. This makes it completely backwards compatible. I'll see if I can get some time to do this myself! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions