Crescendo icon indicating copy to clipboard operation
Crescendo copied to clipboard

Generated commands cannot handle output written to the error stream

Open draproctor opened this issue 3 years ago • 2 comments

Today I was attempting to write wrappers around some binaries used at my company. These binaries write to stderr when an error is encountered. Unfortunately, the generated functions use the call operator to invoke the native binaries and stderr output is not captured.

This means that if the native command encounters an error, I cannot write an OutputHandler to parse those errors or throw exceptions.

I'd like to suggest using a System.Diagnostics.Process object to execute the inner commands instead of using the call operator. This would enable a developer to read anything written to the error stream via ErrorHandlers (which could be written the same way as OutputHandlers) and more effectively throw exceptions.

draproctor avatar Mar 12 '22 00:03 draproctor

@draproctor - Thank you for raising this issue -- We are investigating the best implementation to handle this - and I will provide our thinking here as the investigation progresses.

theJasonHelmick avatar Aug 09 '22 23:08 theJasonHelmick

fixed with #170

JamesWTruher avatar Aug 19 '22 23:08 JamesWTruher

Thank you! Fixed/closed - in release: https://www.powershellgallery.com/packages/Microsoft.PowerShell.Crescendo/1.1.0-RC1

theJasonHelmick avatar Aug 08 '23 16:08 theJasonHelmick