Я хочу поймать ошибку от Google Auth, когда я ввел неправильные учетные данные.Он просто выводит Unhandeled Promised Rejection, хотя я пытаюсь уловить ошибку.
Мой код:
const dialogflow = require('dialogflow');
async function listIntents(config){
try{
const intentClient = new dialogflow.IntentsClient(config);
}
catch(error){
console.log("Error Caught")
}
}
listIntents('dfdff');
Вывод ошибки:
UnhandledPromiseRejectionWarning: Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.
at GoogleAuth.<anonymous> (C:\Users\Hein\Desktop\telegram-bot-home\node_modules\google-auth-library\build\src\auth\googleauth.js:168:23)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Hein\Desktop\telegram-bot-home\node_modules\google-auth-library\build\src\auth\googleauth.js:19:58)
at process._tickCallback (internal/process/next_tick.js:68:7)