feat: improved error messages
This commit is contained in:
parent
1c2be88daa
commit
0e388f04ae
4 changed files with 10 additions and 10 deletions
|
|
@ -45,7 +45,7 @@ func checkoutRepositories(repositories []Repository) {
|
||||||
}
|
}
|
||||||
_, err := cloneRepository(repoDestination, url)
|
_, err := cloneRepository(repoDestination, url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error: %v\n", err)
|
log.Printf("ERROR: %v\n", err)
|
||||||
}
|
}
|
||||||
clonedCount = clonedCount + 1
|
clonedCount = clonedCount + 1
|
||||||
progressBarAdd(1)
|
progressBarAdd(1)
|
||||||
|
|
@ -56,8 +56,8 @@ func checkoutRepositories(repositories []Repository) {
|
||||||
progressBarAdd(1)
|
progressBarAdd(1)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log.Printf("error: decided not to clone or pull repository %v\n", repoName)
|
log.Printf("ERROR: decided not to clone or pull repository %v\n", repoName)
|
||||||
log.Printf("error: this is why: %v\n", repoStatus)
|
log.Printf("ERROR: this is why: %v\n", repoStatus)
|
||||||
errorCount = errorCount + 1
|
errorCount = errorCount + 1
|
||||||
progressBarAdd(1)
|
progressBarAdd(1)
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +98,7 @@ func pullRepository(repoName string, repoDestination string) {
|
||||||
pullErrorMsg = append(pullErrorMsg, repoDestination)
|
pullErrorMsg = append(pullErrorMsg, repoDestination)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log.Printf("error: pulling %v\n", err)
|
log.Printf("ERROR: pulling %v\n", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ func manageArguments() {
|
||||||
gitlabToken = envToken
|
gitlabToken = envToken
|
||||||
default:
|
default:
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
log.Printf("fatal: config; gitlab api token not found\n")
|
log.Printf("FATAL: config; gitlab api token not found\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// manage gitlab url option
|
// manage gitlab url option
|
||||||
|
|
@ -38,7 +38,7 @@ func manageArguments() {
|
||||||
gitlabHost = envHost
|
gitlabHost = envHost
|
||||||
default:
|
default:
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
log.Fatalf("fatal: config; gitlab host not found\n")
|
log.Fatalf("FATAL: config; gitlab host not found\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// manage destination option
|
// manage destination option
|
||||||
|
|
@ -47,7 +47,7 @@ func manageArguments() {
|
||||||
repoDestinationPre = envRepoDest
|
repoDestinationPre = envRepoDest
|
||||||
default:
|
default:
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
log.Fatalf("fatal: config; destination not found\n")
|
log.Fatalf("FATAL: config; destination not found\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// add slash 🎩🎸 if not provided
|
// add slash 🎩🎸 if not provided
|
||||||
|
|
@ -72,6 +72,6 @@ func manageArguments() {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
log.Fatalf("fatal: config; no or wrong archive option found\n")
|
log.Fatalf("FATAL: config; no or wrong archive option found\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ func main() {
|
||||||
// fetch repository information from gitlab
|
// fetch repository information from gitlab
|
||||||
repositories, err := fetchRepositoriesGitlab()
|
repositories, err := fetchRepositoriesGitlab()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("fatal: %v", err)
|
log.Fatalf("FATAL: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// manage found repositories
|
// manage found repositories
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ func progressBar(repositories []Repository) {
|
||||||
|
|
||||||
func progressBarAdd(amount int) {
|
func progressBarAdd(amount int) {
|
||||||
if err := bar.Add(amount); err != nil {
|
if err := bar.Add(amount); err != nil {
|
||||||
log.Printf("Progress bar update error: %v\n", err)
|
log.Printf("ERROR: Progress bar update error: %v\n", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue