Skip to Content
avatar image
Former Member

How to throw exception from script in SAP HCI.

script.txtHi Experts,

I have a script in an integration flow, i am trying to throw an exception from script if condition is not met. But it is not working. Kindly help me in completing this.

Regards,

Vijay

script.txt (1.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Dec 21, 2016 at 10:27 AM

    Hello Vijay ,

    Could you please elaborate more on the issue you are facing.?

    Do not see any issue with your script,except there is missing statement "return message;" in last line.

    I am able to see custom exception raised from Integration Process.

    Regards,

    Sriprasad Shivaram Bhat.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 21, 2016 at 11:43 AM

    Hello Vijay,

    Try with the attached code.

    customexception.txt

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 21, 2016 at 11:19 AM

    Hhi Sriprasad,

    I have tried the same but it is failing with the below error message. Kindly help me in solving it.

    javax.script.ScriptException: java.lang.Exception: java.lang.Exception: not valid@ line 25 in script.groovy, cause: java.lang.Exception: not valid

    Regards,

    Vijay

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 21, 2016 at 07:13 PM

    Hello Vijay,

    Can you please share your complete or snippet of Groovy script you have written.One which you have shared is not complete.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded