Release Automation

 View Only
  • 1.  Error handling in Javascript action

    Posted Apr 11, 2018 09:25 AM

    Hello,

     

    As the throw command consume a lot of memory, is there any other way to handle errors in javascript action?

    I tried the following code:

        var mytest = '' + input1

        if (mytest == 1) {return false}

     

    This does not even compile and returns the following error:

         Script execution failed. Exception: :7:2 Invalid return statement return False ^ in at line number 7 at column number 2

     

    Any idea how to execute a return?

     

    Yann



  • 2.  Re: Error handling in Javascript action
    Best Answer

    Posted Apr 11, 2018 12:10 PM

    Since it's a CARA action, you would need a place for the returned value to go.  You can just populate one of the output parameters with a value:

       

         output1='false';

     

    Then another action can check the value of the parameter assigned to Output1 and react accordingly.



  • 3.  Re: Error handling in Javascript action

    Posted Apr 12, 2018 04:07 AM

    Thank you for this answer.

    I was thinking about that at first but was searching a simpler way to implement this.