Example #1
0
 public InstallerException(int exitCode, PackageManifest packageManifest, ExistReason exitReason, string logPath)
     : base(GetMessage(exitCode, packageManifest, exitReason, logPath))
 {
     PackageManifest = packageManifest;
     LogPath         = logPath;
     ExitReason      = exitReason;
     ExitCode        = exitCode;
 }
Example #2
0
        private static string GetMessage(int exitCode, PackageManifest packageManifest, ExistReason existReason, string logPath)
        {
            var msg = $"Installer for {packageManifest.Name} {packageManifest.Version} returned with a non-zero exit code: {exitCode}.";

            if (existReason != null)
            {
                msg += $" {existReason.Message}";
            }

            if (!string.IsNullOrWhiteSpace(logPath))
            {
                msg += Environment.NewLine + $"Logs: {logPath}";
            }

            return(msg);
        }