Add more information to job process failure error#7251
Merged
iSazonov merged 7 commits intoPowerShell:masterfrom Jul 12, 2018
Merged
Add more information to job process failure error#7251iSazonov merged 7 commits intoPowerShell:masterfrom
iSazonov merged 7 commits intoPowerShell:masterfrom
Conversation
PaulHigin
suggested changes
Jul 9, 2018
| catch (Exception exception) | ||
| { | ||
| exitCode = -1; | ||
| exitMessage = StringUtil.Format("<Unable to read streams from job process for reason '{0}'>", exception.Message); |
Contributor
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(); |
Contributor
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.
Collaborator
Author
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
iSazonov
reviewed
Jul 10, 2018
| <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> |
Collaborator
There was a problem hiding this comment.
Maybe split on three line?
Collaborator
Author
There was a problem hiding this comment.
Yes that would be nicer. Is that "allowed" in error messages?
Collaborator
There was a problem hiding this comment.
We already have multiline error messages.
Collaborator
|
Reopen the PR to restart CIs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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