fix(pr/shared): improve ParseFullReference error message
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
bd0177b039
commit
0d8a697c7c
2 changed files with 6 additions and 1 deletions
|
|
@ -349,7 +349,7 @@ func ParseFullReference(s string) (ghrepo.Interface, int, error) {
|
|||
|
||||
number, err := strconv.Atoi(m[3])
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("invalid reference: %q", s)
|
||||
return nil, 0, fmt.Errorf("invalid reference: %q; %w", s, err)
|
||||
}
|
||||
|
||||
owner := m[1]
|
||||
|
|
|
|||
|
|
@ -160,6 +160,11 @@ func TestParseFullReference(t *testing.T) {
|
|||
arg: "OWNER/#123",
|
||||
wantErr: `invalid reference: "OWNER/#123"`,
|
||||
},
|
||||
{
|
||||
name: "invalid full form, too large number",
|
||||
arg: "OWNER/REPO#9999999999999999999",
|
||||
wantErr: `invalid reference: "OWNER/REPO#9999999999999999999"; strconv.Atoi: parsing "9999999999999999999": value out of range`,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue