From 9efc5665207b5bab35fbefbc3b88adbc91684128 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Wed, 15 Jul 2009 15:23:55 +0200 Subject: [PATCH] Better error reporting. --- src/commands/Pull.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/commands/Pull.cpp b/src/commands/Pull.cpp index 3c45c10..c9329a9 100644 --- a/src/commands/Pull.cpp +++ b/src/commands/Pull.cpp @@ -115,7 +115,22 @@ AbstractCommand::ReturnCodes Pull::run() QStringList arguments; arguments << "ls-remote" << "--heads" << "--tags" << remoteRepo.url(); GitRunner runner(git, arguments); - ReturnCodes rc = runner.start(GitRunner::WaitForStandardOutput); + runner.setTimeout(5 * 60 * 1000); // network stuff, 5 min timeout. + ReturnCodes rc = runner.start(GitRunner::WaitForStandardOutput, GitRunner::FailureAccepted); + if (rc == AbstractCommand::GitFailed) { + if (git.exitCode() == 128) { + QString error = QString::fromLocal8Bit(git.readAllStandardError()); + Logger::error() << "Vng failed: can not read the remote repo"; + if (error.startsWith("ssh:")) { + Logger::error() << ", please check network or and access rights."; + } else if (error.indexOf("does not look like a v2 bundle file")) { + Logger::error() << ", it doesn't look like a valid repo."; + } + Logger::error() << "\n"; + Logger::info() << error; + return rc; + } + } if (rc) { Logger::error() << "Vng failed: No repository found at `" << remoteRepo.url() << "'\n"; return rc; -- 2.11.4.GIT