r/learncpp • u/Mowgl333 • Mar 20 '21
Catching Child Process Exception In Parent Process
I have a Parent process and a Child process being started using std::system(...). I want to throw an exception in Child and catch it in Parent (e.g. when Parent passes an invalid file path to Child).
- Is this possible using native C++?
- Is it idiomatic? The alternative seems to be to define return codes for
Childand analyze those inParent.
I found the following related thread re. Python but haven't found much guidance with respect to C++. Appreciate your thoughts.
5
Upvotes
View all comments
Show parent comment
1
u/Mowgl333 Mar 21 '21
Thanks, that's helpful. Though, this leads me back to my original question: how does the debugging API handle this sort of thing?