keyring swap, better error messages/warnings, delay upgrade notif

This commit is contained in:
Maidul Islam
2023-08-01 21:11:30 -04:00
parent 285a6d633a
commit 7f69a3b23f
22 changed files with 265 additions and 604 deletions

View File

@@ -5,6 +5,7 @@ import (
"os"
"github.com/fatih/color"
"github.com/rs/zerolog/log"
)
func HandleError(err error, messages ...string) {
@@ -16,12 +17,11 @@ func PrintErrorAndExit(exitCode int, err error, messages ...string) {
if len(messages) > 0 {
for _, message := range messages {
fmt.Println(message)
log.Info().Msg(message)
}
}
supportMsg := fmt.Sprintf("\n\nIf this issue continues, get support at https://infisical.com/slack")
fmt.Fprintln(os.Stderr, supportMsg)
log.Info().Msg("If this issue continues, get support at https://infisical.com/slack")
os.Exit(exitCode)
}
@@ -45,5 +45,5 @@ func PrintErrorMessageAndExit(messages ...string) {
}
func printError(e error) {
color.New(color.FgRed).Fprintf(os.Stderr, "Hmm, we ran into an error: %v\n", e)
log.Error().Msg(e.Error())
}