cancel
Showing results for 
Search instead for 
Did you mean: 

How to throw exception from script in SAP HCI.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Sriprasadsbhat
Active Contributor
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Vijay,

Try with the attached code.

customexception.txt

Sriprasad Shivaram Bhat

Former Member
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

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.