Skip to content

Commit

Permalink
Issue SergeyTeplyakov#260 Added som error codes to examples for the e…
Browse files Browse the repository at this point in the history
…rror related warnings.
  • Loading branch information
mkerkelpgr committed Oct 17, 2023
1 parent 095d9d5 commit 8318d9f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -76,6 +76,8 @@ Correct exception handling is a very complex topic, but one case that is very co

To avoid this anti-pattern, the analyzer will warn you if the code only traces the `Exception` property without "looking inside":

**EPC12 - Suspicious exception handling: only '' is observed in the catch block.**

```csharp
try
{
@@ -87,7 +89,9 @@ catch (Exception e)
Console.WriteLine(e.Message);
// ~~~~~~~
}

```
**ERP022 - swallows an unobserved exception.**
```csharp
try
{
Console.WriteLine();
@@ -98,7 +102,9 @@ catch (Exception e)
return;
// ~~~~~~
}

```
**ERP021 - incorrect exception propagation. Use 'throw;' instead**
```csharp
try
{
Console.WriteLine();

0 comments on commit 8318d9f

Please sign in to comment.