Make a function for error handling of the spawn to make code simple.

The addition of an argument: EventInfo is for a future extension
that logs the event detail.