In your code you explicitly catch Exception. That why the execution continue. If you want stop the execution if any exception is catched so you need to throw an exception. Throw new Exception(ex.getMessage());
But it's not the best practice. Try to catch only declared exceptions, not the high level Exception class.