1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-10-30 23:57:50 +02:00

fix(getConfig): add error handling for config JSON marshalling

Co-authored-by: Ashly Mathew <ashly.mathew@sap.com>
Co-authored-by: Jordi van Liempt <35920075+jliempt@users.noreply.github.com>
This commit is contained in:
raman-susla-epam
2022-09-01 12:33:28 +03:00
committed by GitHub
parent 0ef399cd1c
commit bf57938520

View File

@@ -222,7 +222,10 @@ func generateConfig(utils getConfigUtils) error {
return err
}
myConfigJSON, _ := config.GetJSON(stepConfig.Config)
myConfigJSON, err := config.GetJSON(stepConfig.Config)
if err != nil {
return fmt.Errorf("failed to get JSON from config: %w", err)
}
if len(configOptions.outputFile) > 0 {
err := utils.FileWrite(configOptions.outputFile, []byte(myConfigJSON), 0666)