Return an error for a custom action

Return an error for a custom action

HEllo,

i have a report view with an action possible for each record.

In my function, i added a if, to perform an action when a certain condition is filled.
When the condition is not filled ( in my "else"), i would like to return an error to my application (right now, the success message appears anyway), so the user understands that the condition was not filled.

How should I do that ? Should I do it in my function (through a "else"), or somewhere else in zoho creator ?

Thank you so much for your answer.
Guillaume