Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yabberyabber
Copy link
Contributor

Small quality of life improvement - if Fetch can return a distinct error type
as opposed to fmt.Errorf("couldn't find remote ref") then it becomes very easy
for callers to determine what kind of failure occurred using the new-ish
errors.Is and errors.As api.

ref https://golang.org/pkg/errors/

It can be useful for callers to distinguish between an error of
"couldn't find remote ref" and some other error like "network error".

Creating an explicit error type for this allows consumers to
determine the kind of error using the errors.Is and errors.As
interface added in go1.13
@mcuadros mcuadros changed the title Fetch should return a unique error type when ref not found Remote.Fetch: return a unique error type when ref not found Oct 9, 2020
@mcuadros mcuadros merged commit 97741e7 into go-git:master Oct 9, 2020
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.

2 participants