Add more information to job process failure error#7251
Add more information to job process failure error#7251iSazonov merged 7 commits intoPowerShell:masterfrom
Conversation
| catch (Exception exception) | ||
| { | ||
| exitCode = -1; | ||
| exitMessage = StringUtil.Format("<Unable to read streams from job process for reason '{0}'>", exception.Message); |
There was a problem hiding this comment.
This error message string should also go into the resx file for eventual localization.
| { | ||
| var jobProcess = (Process)sender; | ||
| exitCode = jobProcess.ExitCode; | ||
| exitMessage = exitCode == 0 ? jobProcess.StandardOutput.ReadToEnd() : jobProcess.StandardError.ReadToEnd(); |
There was a problem hiding this comment.
Is it possible for both stdout and stderror to have information on exit? We may want to read both, but I think this is fine for now.
There was a problem hiding this comment.
Yeah I was thinking the same - wasn't sure what the policy is on cramming too much information into a single error message
| <value>This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.</value> | ||
| </data> | ||
| <data name="ProcessExitInfo" xml:space="preserve"> | ||
| <value>Exit code {0}, stdout '{1}', stderr '{2}'.</value> |
There was a problem hiding this comment.
Maybe split on three line?
There was a problem hiding this comment.
Yes that would be nicer. Is that "allowed" in error messages?
There was a problem hiding this comment.
We already have multiline error messages.
|
Reopen the PR to restart CIs. |
PR Summary
Adds more information to the exception thrown when the process running a job exits unexpectedly. This is part of an attempt to work out why a particular
Stop-Jobtest is failing in CI. See #7249.We can change the particular implementation and error message as needed. Even if we decide not to merge it, opening the PR may still help us to diagnose the problem.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests