Exception if grpc::GoogleDefaultCredentials fails and error handling

閲覧: 24 回
最初の未読メッセージにスキップ

Eugene Abramov

未読、
2016/10/18 4:16:272016/10/18
To: grpc.io
Hello, 

If the file application_default_credentials.json is missing the function grpc::GoogleDefaultCredentials fails with a critical error. How to fix it?

How to check for errors?

auto Credentials = grpc::GoogleDefaultCredentials ();      <- Exception here before return from this function
                     
if (Credentials) {    // It`s correct?
    
} else {  }  // If Error

And how to check for connect errors?

auto Channel = grpc::CreateChannel ("speech.googleapis.com", Credentials);

auto stub = GoogleSpeechAPI::Speech::NewStub (Channel);

Channel->GetState () ? 

Yang Gao

未読、
2016/11/15 17:11:502016/11/15
To: grpc.io
What kind of error are you seeing?
Are there any error logs printed?
全員に返信
投稿者に返信
転送
新着メール 0 件