Replace sys.exit() by various Exceptions