Add JavaScript fault tolerance

Add JavaScript fault tolerance