diff --git a/commands.cpp b/commands.cpp index b3a052a..dddf250 100644 --- a/commands.cpp +++ b/commands.cpp @@ -617,10 +617,10 @@ static void load_key (Key_file& key_file, const char* key_name, const char* key_ } key_file.load(key_file_in); } else { - std::ifstream key_file_in(get_internal_key_path(key_name).c_str(), std::fstream::binary); + std::string internal_key_path(get_internal_key_path(key_name)); + std::ifstream key_file_in(internal_key_path.c_str(), std::fstream::binary); if (!key_file_in) { - // TODO: include key name in error message - throw Error("Unable to open key file - have you unlocked/initialized this repository yet?"); + throw Error("Unable to open key file: " + internal_key_path + " - have you unlocked/initialized this repository yet?"); } key_file.load(key_file_in); }