-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Error Handling
Might want to use log.Fatalf judiciously.
Terminating the program on every error might not always be the best approach. Consider whether a non-critical error should instead log a warning or skip to the next contract.
Instead of directly terminating, aggregate errors and report them all at the end (if applicable) , imo..
Maybe create a function ;
func checkError(msg string, err error) { if err != nil { log.Printf("ERROR: %s: %v", msg, err) return } }
Then replace repetitive error handling with:
checkError(fmt.Sprintf("reading artifact %s", name), err)
Metadata
Metadata
Assignees
Labels
No labels