You've already forked sap-jenkins-library
							
							
				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:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user