How to rethrow exception

Hi,

I want to throw a custom exception using a script, if a file is not present in a folder.
I am using the following:

throw new Exception(“Input File Not Present”);

can anyone tell me what’s wrong?

Hi @ayush.
Can you please share your script? Do you use Custom Script action or Bot task?

I was not using the Bot Task. Rather I tried to write the code directly available in the actions flow

@CustomScriptAction(
)

def customScript() {
throw new Exception(“Input File Not Present”);
}

And what the error did you receive? Can you please show all full error message text?

Hi @ayush,

Did you tried putting this code inside executeGroovyScript function ‘throw new Exception(“Input File Not Present”)’ and tried executing.

Please let me know if any error thrown.