Usually there are three Options:
- Use exit. Quit the program.
- Use exception. Throw exceptions, handles elsewhere.
- Set global status variable. Set global status, and let other functions checkt the status and handle it.
Hope someone would come up with other options.