private static ExitCode Run(string[] args, ITaskHandler handler, bool gui)
{
try
{
return new BootstrapProcess(handler, gui).Execute(args);
}
#region Error handling
catch (OperationCanceledException)
{
return ExitCode.UserCanceled;
}
catch (OptionException ex)
{
handler.Error(ex);
return ExitCode.InvalidArguments;
}
catch (FormatException ex)
{
handler.Error(ex);
return ExitCode.InvalidArguments;
}
catch (WebException ex)
{
handler.Error(ex);
return ExitCode.WebError;
}
catch (NotSupportedException ex)
{
handler.Error(ex);
return ExitCode.NotSupported;
}
catch (IOException ex)
{
handler.Error(ex);
return ExitCode.IOError;
}
catch (UnauthorizedAccessException ex)
{
handler.Error(ex);
return ExitCode.AccessDenied;
}
catch (InvalidDataException ex)
{
handler.Error(ex);
return ExitCode.InvalidData;
}
catch (SignatureException ex)
{
handler.Error(ex);
return ExitCode.InvalidSignature;
}
catch (DigestMismatchException ex)
{
Log.Info(ex.LongMessage);
handler.Error(ex);
return ExitCode.DigestMismatch;
}
catch (SolverException ex)
{
handler.Error(ex);
return ExitCode.SolverError;
}
catch (ExecutorException ex)
{
handler.Error(ex);
return ExitCode.ExecutorError;
}
#endregion
}
}