diff --git a/modules/rotate/rotate.go b/modules/rotate/rotate.go index 179c184..953117a 100644 --- a/modules/rotate/rotate.go +++ b/modules/rotate/rotate.go @@ -143,7 +143,7 @@ func CheckIAMErr(err error, profile, username string) { fmt.Printf("%v Unknown error %v\n", red.Sprintf("[-]"), bold.Sprintf(`¯\_(ツ)_/¯`)) default: if aerr.Error()[:21] == "NoCredentialProviders" { - fmt.Printf("[-] Profile %s not found\n", profile) + fmt.Printf("%v Profile %v not found\n", red.Sprintf("[-]"), bold.Sprintf(profile)) } else if aerr.Error()[:12] == "AccessDenied" { if username == "" { username = GetUsername(profile) @@ -156,7 +156,7 @@ func CheckIAMErr(err error, profile, username string) { } else { fmt.Printf("%v Generic error: %v\n", red.Sprintf("[-]"), err.Error()) } - os.Exit(1) + os.Exit(3) } } diff --git a/modules/writer/writer.go b/modules/writer/writer.go index b347905..d8d0163 100644 --- a/modules/writer/writer.go +++ b/modules/writer/writer.go @@ -53,7 +53,10 @@ func Reader() string { //keys and replace them with the new ones func UpdateCredentials(awsCredentials, oldKey, newKey string) { read, err := ioutil.ReadFile(awsCredentials) - CheckErr(err) + if err != nil { + fmt.Printf("%v Error reading %v\n", red.Sprintf("[-]"), bold.Sprintf(awsCredentials)) + os.Exit(2) + } newKeys := strings.Replace(string(read), oldKey, newKey, -1)