How to throw a user-defined exception from a Script (VTL) speed template?
From my script speed, I need to throw an exception based on the condition so that the caller can catch the exception and present useful error messages to the user.
Example.
#if($passwordfield1 != $passwordfield2) throw an exception here
In the above example, if passwordfield1 and passwordfield2 do not match, the appropriate exception should be thrown, which should be passed to the end user.
Is there a way to achieve this with a script speed? If not, suggest an alternative approach.
source share