pid = SomeProcess()
error_message = pid->on_error()
when error_message:
print("Process exited with error: " + to_string(error_message))
end
# normal exit case
exit_message = pid->on_exit()
when exit_message:
print("Process exited normally with message: " + to_string(exit_message))
end
Allow monitoring of processes for failure.