首页 > 解决方案 > Google Videointelligence API - UnhandledPromiseRejectionWarning,每分钟请求数

问题描述

我正在使用 Google Videointelligence API 并根据配额和限制的文档,我可以并行处理约 3 个视频(并且工作正常),但是当我并行处理超过 3 个视频时,会引发异常。

问题是我无法捕捉到这个异常!

例外:(节点:31660)UnhandledPromiseRejectionWarning:错误:8 RESOURCE_EXHAUSTED:配额指标“请求”超出配额,并限制消费者“project_number:852521347926”的服务“videointelligence.googleapis.com”的“每分钟请求数”。

我在 node.js 中写作。

代码就像示例一样:

const [operation] = await client.annotateVideo(request);
logger.debug('Waiting for enrichment operation to complete...');
try{
        const [operationResult] = await operation.promise(); //Exception was thrown on this line
}catch(err){
        console.log("exception was caught");//failed to catch the exception
}

标签: node.jsvideo-intelligence-api

解决方案


推荐阅读