How To Handle Exception In Javascript