ZeroInstall.Program.Run C# (CSharp) Method

Run() private static method

Runs the application.
private static Run ( string args, ITaskHandler handler, bool gui ) : ExitCode
args string The command-line arguments passed to the application.
handler ITaskHandler A callback object used when the the user needs to be asked questions or informed about download and IO tasks.
gui bool true if the application was launched in GUI mode; false if it was launched in command-line mode.
return ExitCode
        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
        }
    }