Error handling

I have been using eggplant from over a week now and I am trying to get the try-catch to work within my handler. If my testcase uses this handler and if my handler has a problem I want my tc to fail and move on to the next testcase but it stops at the handler level and does not fail the testcase.

My testcase passes a set of images to the handler and if the handler does not find image I want the tc to fail by exiting from the handler.

This is what I am doing

to handlername
try
click image1
some statements
click image2
click image3
catch
LogError “image not found”
end try
exit handlername
end handler name

Can someone point me to the right direction please? :expressionless:

I think this is what you are looking for:

to handlername
    try
        click image1
        some statements
        click image2
        click image3
    catch
        LogError "image not found"
        exit script
    end try
end handler name

This will exit the current script, but not the script that called it. But I’m not sure how you are running your “test cases” or even what constitutes a test case – is that just a script in your scenario?

try

catch theException
logerror theException
exit
end try

I recommended to use theException , Exit