mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
artifactPrepareVersion: improve error categorization (#1936)
* artifactPrepareVersion: improve error categorization * Update getConfig.go Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
This commit is contained in:
parent
07b5142417
commit
b18bcee533
@ -336,6 +336,10 @@ func pushChanges(config *artifactPrepareVersionOptions, newVersion string, repos
|
||||
log.SetErrorCategory(log.ErrorConfiguration)
|
||||
case strings.Contains(errText, "Permission"):
|
||||
log.SetErrorCategory(log.ErrorConfiguration)
|
||||
case strings.Contains(errText, "authorization failed"):
|
||||
log.SetErrorCategory(log.ErrorConfiguration)
|
||||
case strings.Contains(errText, "authentication required"):
|
||||
log.SetErrorCategory(log.ErrorConfiguration)
|
||||
case strings.Contains(errText, "knownhosts: illegal base64"):
|
||||
err = errors.Wrap(err, "known_hosts file seems invalid")
|
||||
log.SetErrorCategory(log.ErrorConfiguration)
|
||||
|
@ -38,7 +38,8 @@ func ConfigCommand() *cobra.Command {
|
||||
Run: func(cmd *cobra.Command, _ []string) {
|
||||
err := generateConfig()
|
||||
if err != nil {
|
||||
log.Entry().WithField("category", "config").WithError(err).Fatal("failed to retrieve configuration")
|
||||
log.SetErrorCategory(log.ErrorConfiguration)
|
||||
log.Entry().WithError(err).Fatal("failed to retrieve configuration")
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user