Forum Discussion

trans-am's avatar
Occasional Contributor
2 years ago

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() // This is OK. List is printed to the conso...
  • Shashavali's avatar
    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  

         "carriedFromPrevious = " + carried) 


                   catch (Exception ex)


                  "Respond not a number")


                            }"carriedFromPrevious = " + carried) 

  • trans-am's avatar
    2 years ago

    Ok, works now. I had a little error in my script.