File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ DestWorker::DestWorker(GrpcDestWorker *s)
47
47
formatter(s->super.owner->super.super.super.cfg)
48
48
{
49
49
std::shared_ptr<::grpc::ChannelCredentials> credentials = DestWorker::create_credentials ();
50
+ if (!credentials)
51
+ {
52
+ msg_error (" Error querying OTel credentials" ,
53
+ evt_tag_str (" url" , this ->owner .get_url ().c_str ()),
54
+ log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
55
+ throw std::runtime_error (" Error querying OTel credentials" );
56
+ }
57
+
50
58
::grpc::ChannelArguments args = this ->create_channel_args ();
51
59
52
60
channel = ::grpc::CreateCustomChannel (owner.get_url (), credentials, args);
Original file line number Diff line number Diff line change @@ -56,7 +56,15 @@ LogThreadedDestWorker *
56
56
DestDriver::construct_worker (int worker_index)
57
57
{
58
58
GrpcDestWorker *worker = grpc_dw_new (this ->super , worker_index);
59
- worker->cpp = new DestWorker (worker);
59
+ try
60
+ {
61
+ worker->cpp = new DestWorker (worker);
62
+ }
63
+ catch (const std::runtime_error &e)
64
+ {
65
+ log_threaded_dest_worker_free (&worker->super );
66
+ return NULL ;
67
+ }
60
68
return &worker->super ;
61
69
}
62
70
You can’t perform that action at this time.
0 commit comments