bug #5022 :   The javascript function stop is triggered also when an error occurs