dotnet / dotnet/docs

Include 'params' in exceptions

Open
#36,504 0 comments 0 reactions 0 assignees View on GitHub
:watch: Not Triaged dotnet-fundamentals/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
19h 10m
Merged PRs (30d)
268

Description

In the [special cases](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1068#special-cases) section, two cases where it's OK for a `CancellationToken` parameter to precede other parameters are provided.

However there's another instance where it makes sense: when using a variable number of arguments (`params` parameter).

Can PR if agreed.

---
#### Document Details

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

* ID: 69d87d60-af4e-e343-b2c2-2917e8406a3e
* Version Independent ID: 1f53137e-0b95-d713-c66e-e390395359c7
* Content: [CA1068: CancellationToken parameters must come last (code analysis) - .NET](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1068)
* Content Source: [docs/fundamentals/code-analysis/quality-rules/ca1068.md](https://github.com/dotnet/docs/blob/main/docs/fundamentals/code-analysis/quality-rules/ca1068.md)
* Product: **dotnet-fundamentals**
* GitHub Login: @mavasani
* Microsoft Alias: **mavasani**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.