I've started using std::invalid_argument for this kind of error