Commit 549e9fda authored by Alastair Robertson's avatar Alastair Robertson

Cleanly exit when unable to attach a probe

parent a75340a1
...@@ -64,7 +64,15 @@ int BPFtrace::run() ...@@ -64,7 +64,15 @@ int BPFtrace::run()
std::cerr << "Code not generated for probe: " << probe.name << std::endl; std::cerr << "Code not generated for probe: " << probe.name << std::endl;
return -1; return -1;
} }
attached_probes.push_back(std::make_unique<AttachedProbe>(probe, func->second)); try
{
attached_probes.push_back(std::make_unique<AttachedProbe>(probe, func->second));
}
catch (std::runtime_error e)
{
std::cerr << e.what() << std::endl;
return -1;
}
} }
// TODO wait here while script is running // TODO wait here while script is running
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment