const char to std::string in lastError