JavaScript : Error handling: empty catch block