throw std::runtime_error rather than std::exception.