JavaScript error handling.