From ace1fb2c405871189be6943eff3b6a820139f4ea Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 17 Jun 2012 22:57:15 +0100 Subject: [PATCH] setup: show raw (git) error message on failed add --- SparkleLib/Git/SparkleFetcherGit.cs | 5 ++++- SparkleShare/Linux/SparkleSetup.cs | 7 ++++++- SparkleShare/Mac/SparkleSetup.cs | 10 ++++++++-- SparkleShare/Windows/SparkleSetup.cs | 8 ++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 2d8756d8..3b732a8a 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -128,8 +128,11 @@ namespace SparkleLib.Git { } else { SparkleHelpers.DebugInfo ("Fetcher", line); - if (line.StartsWith ("fatal:")) + if (line.StartsWith ("fatal:", true, null) || + line.StartsWith ("error:", true, null)) { + base.errors.Add (line); + } } diff --git a/SparkleShare/Linux/SparkleSetup.cs b/SparkleShare/Linux/SparkleSetup.cs index b0067719..090e58a4 100755 --- a/SparkleShare/Linux/SparkleSetup.cs +++ b/SparkleShare/Linux/SparkleSetup.cs @@ -475,8 +475,13 @@ namespace SparkleShare { points.PackStart (point_two, false, false, 12); if (warnings.Length > 0) { + string warnings_markup = ""; + + foreach (string warning in warnings) + warnings_markup += "\n" + warning + ""; + Label label_three = new Label () { - Markup = "Here's the raw error message:\n" + warnings [0] + "", + Markup = "Here's the raw error message:" + warnings_markup, Wrap = true, Xalign = 0 }; diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs index c516419e..93ebf6ca 100755 --- a/SparkleShare/Mac/SparkleSetup.cs +++ b/SparkleShare/Mac/SparkleSetup.cs @@ -578,8 +578,14 @@ namespace SparkleShare { "
  • Do you have access rights to this remote project?
  • " + ""; - if (warnings.Length > 0) - html = html.Replace ("", "
  • Here's the raw error message:
    " + warnings [0] + "
  • "); + if (warnings.Length > 0) { + string warnings_markup = ""; + + foreach (string warning in warnings) + warnings_markup += "
    " + warning + ""; + + html = html.Replace ("", "
  • Here's the raw error message: " + warnings_markup + "
  • "); + } web_view.MainFrame.LoadHtmlString (html, new NSUrl ("")); web_view.DrawsBackground = false; diff --git a/SparkleShare/Windows/SparkleSetup.cs b/SparkleShare/Windows/SparkleSetup.cs index c3633760..f405dc4e 100644 --- a/SparkleShare/Windows/SparkleSetup.cs +++ b/SparkleShare/Windows/SparkleSetup.cs @@ -500,9 +500,13 @@ namespace SparkleShare { help_block.Inlines.Add ("Do you have access rights to this remote project?"); if (warnings.Length > 0) { - help_block.Inlines.Add ("\n\nHere's the raw error message:\n"); - help_block.Inlines.Add (new Bold (new Run (warning [0]))); bullets_block.Text += "\n\n•"; + help_block.Inlines.Add ("\n\nHere's the raw error message:"); + + foreach (string warning in warnings) { + help_block.Inlines.Add ("\n"); + help_block.Inlines.Add (new Bold (new Run (warning))); + } } Button cancel_button = new Button () {