Refactor `std::exit()` out of the codebase and replace it with exceptions
Refactor
std::exit()out of the codebase and replace it with exceptions