- Changed the wording on most error messages and diagnostics so that
  the user is not alarmed, and is somewhat guided toward a solution.
This commit is contained in:
Paul Beckingham 2010-10-06 23:29:45 -04:00
parent 4028a2fce4
commit 74dcdd897a
11 changed files with 118 additions and 123 deletions

View file

@ -36,19 +36,18 @@ TransportRSYNC::TransportRSYNC(const Uri& uri) : Transport(uri)
////////////////////////////////////////////////////////////////////////////////
void TransportRSYNC::send(const std::string& source)
{
if (uri.host == "") {
throw std::string ("Hostname is empty");
}
if (uri.host == "")
throw std::string ("when using the 'rsync' protocol, the uri must contain a hostname.");
// Is there more than one file to transfer?
// Then path has to end with a '/'
if (is_filelist(source) && !uri.is_directory())
throw std::string ("'" + uri.path + "' is not a directory!");
throw std::string ("The uri '"); + uri.path + "' does not appear to be a directory.";
// cmd line is: rsync [--port=PORT] source [user@]host::path
if (uri.port != "")
{
arguments.push_back ("--port=" + uri.port);
arguments.push_back ("--port=" + uri.port);
}
arguments.push_back (source);
@ -63,26 +62,23 @@ void TransportRSYNC::send(const std::string& source)
}
if (execute())
throw std::string ("Failed to run rsync!");
throw std::string ("Could not run rsync. Is it installed, and available in $PATH?");
}
////////////////////////////////////////////////////////////////////////////////
void TransportRSYNC::recv(std::string target)
{
if (uri.host == "") {
throw std::string ("Hostname is empty");
}
if (uri.host == "")
throw std::string ("when using the 'rsync' protocol, the uri must contain a hostname.");
// Is there more than one file to transfer?
// Then target has to end with a '/'
if (is_filelist(uri.path) && !is_directory(target))
throw std::string ("'" + target + "' is not a directory!");
throw std::string ("The uri '"); + target + "' does not appear to be a directory.";
// cmd line is: rsync [--port=PORT] [user@]host::path target
if (uri.port != "")
{
arguments.push_back ("--port=" + uri.port);
}
arguments.push_back ("--port=" + uri.port);
if (uri.user != "")
{
@ -96,7 +92,7 @@ void TransportRSYNC::recv(std::string target)
arguments.push_back (target);
if (execute())
throw std::string ("Failed to run rsync!");
throw std::string ("Could not run rsync. Is it installed, and available in $PATH?");
}
////////////////////////////////////////////////////////////////////////////////