mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-20 05:19:40 +02:00
fix: stackoverflow error when writing cpe file (#2729)
* catch stackoverflow error * update log * update log * update log * explicit return if value null * wip * wip * wip * wip * prevent error * cleanup * cleanup * use notify * removed import Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
parent
b70af2651e
commit
b612a1fb3f
@ -206,11 +206,15 @@ class commonPipelineEnvironment implements Serializable {
|
||||
}
|
||||
|
||||
void writeValueToFile(script, String filename, value){
|
||||
if (value){
|
||||
if (!(value in CharSequence)) filename += '.json'
|
||||
if (script.fileExists(filename)) return
|
||||
if (!(value in CharSequence)) value = groovy.json.JsonOutput.toJson(value)
|
||||
script.writeFile file: filename, text: value
|
||||
try{
|
||||
if (value){
|
||||
if (!(value in CharSequence)) filename += '.json'
|
||||
if (script.fileExists(filename)) return
|
||||
if (!(value in CharSequence)) value = groovy.json.JsonOutput.toJson(value)
|
||||
script.writeFile file: filename, text: value
|
||||
}
|
||||
}catch(StackOverflowError error) {
|
||||
script.echo("failed to write file: " + filename)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user