Skip to content

intercept and track the platform not supported exceptions - #498

Merged
jonsequitur merged 4 commits into
dotnet:masterfrom
colombod:feature/platform_not_supported
Apr 26, 2019
Merged

jonsequitur merged 4 commits into
dotnet:masterfrom
colombod:feature/platform_not_supported

Conversation

@colombod

Copy link
Copy Markdown
Member

trying to address #497
The issue so far manifests only on mono when compiled with following symbols

  • MONOTOUCH
  • MONODROID
  • XAMMAC
  • WASM
    see for more details

@colombod
colombod requested a review from jonsequitur April 24, 2019 13:07
Comment thread src/System.CommandLine/Platform.cs Outdated
internal static class Platform
{
private static bool? _isWasm;
public static bool IsWasm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call this something like IsConsoleRedirectionSupported or something? This isn't definitive proof that we're running under WASM, although I'm not aware of other cases where this would happen.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind of agree but note that the not supported operation ahs nothing to do with redirection per se, that seems to be support, is to call IsOutputRedirected, or IsErrorRedirected or IsInputRedirected that is not supported.

@jonsequitur
jonsequitur merged commit 74e414a into dotnet:master Apr 26, 2019
@amis92

amis92 commented Oct 10, 2019

Copy link
Copy Markdown

@colombod @jonsequitur I think during the rename from IsWasm to IsConsoleRedirectionCheckSupported the actual meaning of the value was inversed, but the code using it wasn't, which results in the current code being very much contradicting.

  • IsWasm = true when the accessor IsOutputRedirected threw
  • IsConsoleRedirectionCheckSupported = true is now when the exception is thrown, as well.

The code as it is works as expected, but any other person using this Platform API that doesn't check the actual implementation will use it exactly in the opposite way.

I'm not sure I should raise it as a separate issue, so I'm commenting here.

@jonsequitur

Copy link
Copy Markdown
Contributor

Nice catch! Please open a separate issue for this.

@colombod
colombod deleted the feature/platform_not_supported branch May 11, 2020 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants