Skip to content

Commit

Permalink
Log package removal errors (#78)
Browse files Browse the repository at this point in the history
log errors when removing package from state file
  • Loading branch information
GitGerby authored Feb 26, 2020
1 parent 802bfd0 commit 27d0b06
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ func resolveDst(dst string) string {
func cleanOld(state *client.GooGetState, pi goolib.PackageInfo, insFiles map[string]string, dbOnly bool) {
st, err := state.GetPackageState(pi)
if err != nil {
// TODO: Use error wrapping here https://blog.golang.org/go1.13-errors
if !strings.Contains(err.Error(), "no match found for package") {
logger.Error(err)
}
return
}
if !dbOnly {
Expand All @@ -454,7 +458,9 @@ func cleanOld(state *client.GooGetState, pi goolib.PackageInfo, insFiles map[str
if st.UnpackDir != "" && oswrap.RemoveAll(st.UnpackDir) != nil {
logger.Error(err)
}
state.Remove(pi)
if err := state.Remove(pi); err != nil {
logger.Error(err)
}
return
}

Expand Down

0 comments on commit 27d0b06

Please sign in to comment.