Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in pattern matching docs bears an incorrect message #36278

Open
jarroput opened this issue Jul 17, 2023 · 1 comment · May be fixed by #43694
Open

Exception in pattern matching docs bears an incorrect message #36278

jarroput opened this issue Jul 17, 2023 · 1 comment · May be fixed by #43694
Assignees
Labels
doc-bug Problem with the content; needs to be fixed [org][type][category] dotnet-csharp/svc in-pr This issue will be closed (fixed) by an active pull request. okr-health okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. Pri2 whats-new/subsvc

Comments

@jarroput
Copy link

The error message of the InvalidOperationException for this case: (true, false, WaterLevel.High) show the opposite of what is actually the case.

public void SetLowGate(bool open)
    {
        LowWaterGateOpen = (open, LowWaterGateOpen, CanalLockWaterLevel) switch
        {
            (false, _, _) => false,
            (true, _, WaterLevel.Low) => true,
            (true, false, WaterLevel.High) => throw new InvalidOperationException("Cannot open high gate when the water is low"),
            _ => throw new InvalidOperationException("Invalid internal state"),
        };
    }

Should be "Cannot open low gate when the water is high"


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Jul 17, 2023
@BillWagner BillWagner self-assigned this Jul 18, 2023
@BillWagner BillWagner added the doc-bug Problem with the content; needs to be fixed [org][type][category] label Jul 18, 2023
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Jul 18, 2023
@ghost ghost added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Jul 18, 2023
@BillWagner
Copy link
Member

Thanks for pointing that out @jarroput

I've added it to our backlog and added the "help wanted" label if anyone wants to submit a PR before we get to it.

@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. labels Nov 22, 2024
@BillWagner BillWagner linked a pull request Nov 22, 2024 that will close this issue
@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Nov 22, 2024
@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-bug Problem with the content; needs to be fixed [org][type][category] dotnet-csharp/svc in-pr This issue will be closed (fixed) by an active pull request. okr-health okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. Pri2 whats-new/subsvc
Projects
Status: 👀 In review
Development

Successfully merging a pull request may close this issue.

3 participants