Skip to content

Commit

Permalink
Real error
Browse files Browse the repository at this point in the history
  • Loading branch information
zentron committed Sep 8, 2024
1 parent d6c88ca commit 3470942
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion source/Calamari.FullFrameworkTools/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static int Main(string[] args)
{
var fileVersionInfo = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
log.Info(fileVersionInfo.ProductVersion);
return 1;
return 0;
}

var commandLocator = new RequestTypeLocator();
Expand All @@ -34,6 +34,7 @@ public static int Main(string[] args)
catch (Exception ex)
{
log.Fatal(ex);
return -1;
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected CalamariResult DeployPackage(string packageName)
{
Variables.Save(variablesFile.FilePath);

return Invoke(Calamari()
return InvokeInProcess(Calamari()
.Action("deploy-package")
.Argument("package", packageName)
.Argument("variables", variablesFile.FilePath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public TResponse Invoke<TRequest, TResponse>(TRequest cmd)
fileSystem.WriteAllBytes(file.FilePath, encRequestObj);

var args = new[] { cmd.GetType().Name, "--password", password, "--file", file.FilePath };
var taskResult = "";
var taskResult = string.Empty;
var error = string.Empty;
var processResult = SilentProcessRunner.ExecuteCommand(path,
string.Join(" ", args),
tempDir.DirectoryPath,
Expand Down Expand Up @@ -70,12 +71,14 @@ public TResponse Invoke<TRequest, TResponse>(TRequest cmd)
Log.Error(line["Message"]?.ToString() ?? string.Empty);
Log.Error(line["Type"]?.ToString() ?? string.Empty);
Log.Error(line["StackTrace"]?.ToString() ?? string.Empty);
throw new Exception(line["Message"]?.ToString());
error = line["Message"]?.ToString();
throw new Exception(error);
case LogLevel.Result:
taskResult = line["Result"]?.ToString();
break;
default:
throw new ArgumentOutOfRangeException();
error = $"Unknown log level {logLevel}";
break;
}
},
Log.Error);
Expand All @@ -84,6 +87,7 @@ public TResponse Invoke<TRequest, TResponse>(TRequest cmd)
{
throw new Exception("Operation failed: "+ processResult.ErrorOutput);
}

return JsonConvert.DeserializeObject<TResponse>(taskResult);
}
}
Expand Down

0 comments on commit 3470942

Please sign in to comment.