From 0399c7cea68a8371e56aa352697684282a0c1285 Mon Sep 17 00:00:00 2001 From: tomfeigin <10672011+tomfeigin@users.noreply.github.com> Date: Thu, 28 Mar 2024 08:54:38 +0200 Subject: [PATCH] Print the unrecognized repository rule type When failing to match the type of a repository rule, print the unmatched name. Previously only the type of the unmatched name was printed, which is always 'string'. This makes it hard to troubleshoot unmarshalling failures. --- github/repos_rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/repos_rules.go b/github/repos_rules.go index 9f4e0245f08..34711dda979 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -204,7 +204,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { default: r.Type = "" r.Parameters = nil - return fmt.Errorf("RepositoryRule.Type %T is not yet implemented, unable to unmarshal", RepositoryRule.Type) + return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", RepositoryRule.Type, RepositoryRule) } return nil