Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Paket.VisualStudio/Restore/PaketRestorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Restore(IEnumerable<RestoringProject> project)
PaketLauncher.LaunchPaket(SolutionExplorerExtensions.GetPaketDirectory(), PaketSubCommand,
(send, args) => PaketOutputPane.OutputPane.OutputStringThreadSafe(args.Data + "\n"));
}
catch (System.Exception ex)
catch (PaketRuntimeException ex)
{
/* One of the known reasons for this block to get executed is that if the paket.exe is old then it is likely
* that --references-file is not supported and --references-files is supported instead. paket-4.8.4 for instance
Expand Down
26 changes: 23 additions & 3 deletions src/Paket.VisualStudio/Utils/PaketLauncher.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.IO;

namespace Paket.VisualStudio.Utils
{

public static class PaketLauncher
{
const string PAKET_EXE = ".paket\\paket.exe";
Expand Down Expand Up @@ -42,7 +44,7 @@ public static void LaunchPaket(string SolutionDirectory, string PaketSubCommand,
/* If something went wrong with paket.bootstrapper.exe e.g. couldn't download paket.exe due to proxy auth error
* then we should not execute the command that was originally issued for paket.exe.
*/
throw new System.Exception("paket.bootstrapper.exe terminated abnormally.");
throw new PaketRuntimeException("paket.bootstrapper.exe terminated abnormally.");
}
else
throw new FileNotFoundException(
Expand All @@ -54,7 +56,25 @@ public static void LaunchPaket(string SolutionDirectory, string PaketSubCommand,
* Now issue the original command to .paket\paket.exe
*/
if (LaunchProcess(SolutionDirectory, PAKET_EXE, PaketSubCommand, PaketDataReceivedHandler) != 0)
throw new System.Exception($"{PAKET_EXE} {PaketSubCommand} failed");
throw new PaketRuntimeException($"{PAKET_EXE} {PaketSubCommand} failed");
}
}

public class PaketRuntimeException : Exception
{
public PaketRuntimeException()
: base()
{
}

public PaketRuntimeException(string message)
: base(message)
{
}

public PaketRuntimeException(string message, Exception inner)
: base(message, inner)
{
}
}
}