Skip to content

Commit 81e838f

Browse files
committed
example: Hint at possible problem when binaries are missing
Helpful when forgetting to build necessary targets.
1 parent 1b8d4a6 commit 81e838f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

example/example.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ static auto Spawn(mp::EventLoop& loop, const std::string& process_argv0, const s
3030
fs::path path = process_argv0;
3131
path.remove_filename();
3232
path.append(new_exe_name);
33+
if (!fs::exists(path))
34+
throw std::runtime_error{std::string{path} + " is missing, probably needs to be built?"};
3335
return {path.string(), std::to_string(fd)};
3436
});
3537
return std::make_tuple(mp::ConnectStream<InitInterface>(loop, fd), pid);

0 commit comments

Comments
 (0)