Fix to display error on try/catch or ajax
remove code from wrong branch