I *really* dislike calling ```exit()```. If you realise something is wrong you can give the error message or handle it some other way, but terminating the programme is not a good solution.
especially when you don't know what whoever calls this function would like to do when this fails.