Try throwing exceptions instead of exiting