Write the JS code of catching browser errors and POST them to my service.