Raise an exception instead of exiting