JavaScript Error handling using JavaScript Debug Mode