Throw exceptions instead of std::strings on errors