18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

_continueOnError() & try does not work together

keatskeats Members
edited November -1 in Sahi - Open Source
Hi Narayan,

It seems in new version of sahi, march version onwards;_continueOnError() & try does not work when used together.
Meaning, It continues if there is an error but the exception is not caught.
_continueOnError overrides try/catch

Is this working as expected or its an issue?

Comments

  • narayannarayan Administrators
    Keats, that is the current behavior. If _continueOnError is set, Sahi does not throw an exception, which is why it does not enter the catch block. If you want both behaviors, you could use
    _stopOnError();
    try{
        // code which throws exception
    }catch(e){
        // corrective action
    }
    _continueOnError();
    
  • keatskeats Members
    Ok thanks.
This discussion has been closed.