Repository navigation
Error stream - #1599
Merged
Merged
Error stream#1599
Conversation
sergei (vors)
force-pushed
the
error-stream
branch
from
August 2, 2016 00:24
6773b2d to
d47fd52
Compare
Contributor
There was a problem hiding this comment.
You don't actually test this statement directly, you only test the the objects returned have an Exception property.
Contributor
Contributor
There was a problem hiding this comment.
IsNativeError [](start = 121, length = 13)
parameters shouldn't start with caps.
Collaborator
Author
|
Jason Shirk (@lzybkr) and me agreed, we are not going to change |
added 3 commits
August 1, 2016 18:39
Fix #1465 On Linux, it's common to use error stream (2) as an information stream. There is no errors in this case, it's just a way to report info. When PowerShell redirects error stream, it wraps all output from stream 2 in NativeCommandError ErrorRecord. That doesn't happen for interactive experience (when there is no redirection), but it shows up in logs, scripting and non-console powershell hosts (i.e. PowerShell ISE). Here we change the formatter, so we are keeping the ErrorRecords objects, but we are changing their default representation. If it's a NativeCommandError, we don't use the regular ErrorRecord formatter. It allows us keep ErrorRecord object, but in redirection case it will look exectly like on the screen. Also, we are change NativeCommandErrorMessage to use one line per ErrorRecord to enable this scenario.
sergei (vors)
force-pushed
the
error-stream
branch
from
August 2, 2016 01:41
d47fd52 to
5690b1a
Compare
Contributor
|
|
Collaborator
Author
|
Jason Shirk (@lzybkr) I will leave it for comments a little bit. Please, merge it tomorrow, if there are no objections. |
Thatgfsj (Thatgfsj)
pushed a commit
to Thatgfsj-contribs/PowerShell
that referenced
this pull request
Aug 6, 2026
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.
Resolves issue Error stream and ErrorRecords #1465.
Code is rebased on
origin/master.Add tests that fail without your changes.
N/A: Update all relevant documentation.
On Linux, it's common to use error stream (2) as an information stream.
There is no errors in this case, it's just a way to report info.
When PowerShell redirects error stream, it wraps all output from stream 2
in NativeCommandError ErrorRecord and subsequent text in
NativeCommandErrorMessage ErrorRecord.
That doesn't happen for interactive experience (when there is no
redirection), but it shows up in logs, scripting and non-console
powershell hosts (i.e. PowerShell ISE).
Here we change the formatter, so we are keeping the ErrorRecords
objects, but we are changing their default representation.
If it's a NativeCommandError, we don't use the regular ErrorRecord
formatter. It allows us keep ErrorRecord object,
but in redirection case it will look exectly like on the screen.
Also, we are change NativeCommandErrorMessage to use one line per
ErrorRecord to enable this scenario.
We also make the error stream messages show-up without red color.
cc Jason Shirk (@lzybkr) James Truher (@JamesWTruher) Bruce Payette (@BrucePay)