trans-am
2 years agoOccasional Contributor
Try-Catch "No such property: carried for the class:" error
Following piece of groovy: import groovy.json.JsonSlurper def response = context.expand( '${GetAccumulated#response}' ).toString() log.info(response) // This is OK. List is printed to the conso...
- 2 years ago
its because you define carried in the try block.
please try to define carried before the try block.
def carried
try {
carried = json.carriedFromPrevious
log.info("carriedFromPrevious = " + carried)
}
catch (Exception ex)
{
log.info("Respond not a number")
log.info(ex)
}
log.info("carriedFromPrevious = " + carried)
- 2 years ago
Ok, works now. I had a little error in my script.