Javascript 谷歌方向API未知\u错误

Javascript 谷歌方向API未知\u错误,javascript,google-maps,google-api,Javascript,Google Maps,Google Api,我经常从directions API中随机获得未知的错误响应,我无法获得错误示例,因为它显然是随机的。 我试图在谷歌API控制台上找到更多关于此错误的信息或更多详细信息,但我找不到任何关于此的信息。。。GoogleAPI控制台确实显示了错误计数,但没有关于这些错误的详细信息 关于如何调试这个有什么帮助吗 谢谢 const map = new google.maps.Map(elementMap, mapOptions); let origin = new google.maps.LatLng(l

我经常从directions API中随机获得未知的错误响应,我无法获得错误示例,因为它显然是随机的。 我试图在谷歌API控制台上找到更多关于此错误的信息或更多详细信息,但我找不到任何关于此的信息。。。GoogleAPI控制台确实显示了错误计数,但没有关于这些错误的详细信息

关于如何调试这个有什么帮助吗

谢谢

const map = new google.maps.Map(elementMap, mapOptions);
let origin = new google.maps.LatLng(latitude1, longitude1);
let destination = new google.maps.LatLng(latitude2, longitude2);
const waypoints = [{
    location: new google.maps.LatLng(latitude3, longitude3),
    stopover: true
}];


const directionsService = new google.maps.DirectionsService();
const renderOptions = {
    draggable: false,
};
const directionsDisplay = new google.maps.DirectionsRenderer(renderOptions);
directionsDisplay.setMap(map);

const routeData = {
    origin: origin,
    waypoints: waypoints,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING,
    optimizeWaypoints: false,
};

directionsService.route(routeData, (response, status) => {
    if (status === google.maps.DirectionsStatus.OK) {
        directionsDisplay.setDirections(response);
        .........
    } else {
        // ERROR because random status === UNKNOWN_ERROR
    }
});

联系谷歌支持部门或在他们的问题跟踪器中打开问题。未知错误意味着谷歌方面出了问题。尝试实现重试逻辑,如果这无助于在谷歌问题跟踪器中提交错误。参考类似答案:谢谢,很有帮助=)