Fai come ha detto BR1, fatti restituire la stringa ERRORE, ma poi nella condizione non mettere

if(esito!="ERRORE")

bensì

if(esito.indexOf("ERRORE")==-1)