Skip to content

Commit 528e700

Browse files
authored
Update README.md
1 parent d05f55a commit 528e700

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,22 @@ public class Program
5757
All unhandled exceptions are reported manually.
5858
But sometimes you need to deal with exceptions yourself.
5959

60-
To report exceptions manually in your controller, use `this.ReportError(exception)` to allow codeRR to include RouteData, ViewBag, TempData etc when your exception is reported.
61-
If you do not have access to the controller, you can use the `httpContext` (`httpContext.ReportException()`) or just `Err.Report()`.
60+
When doing so, simply report the exception like this:
6261

6362
```csharp
64-
public ActionResult UpdatePost(int uid, ForumPost post)
63+
public void OnPostClick()
6564
{
65+
var model = CreatePostDto();
66+
6667
try
6768
{
68-
_service.Update(uid, post);
69+
_somService.Execute(model);
6970
}
7071
catch (Exception ex)
7172
{
72-
this.ReportException(ex, new{ UserId = uid, ForumPost = post });
73+
this.ReportException(ex, model);
74+
75+
//some custom handling
7376
}
7477
}
7578
```

0 commit comments

Comments
 (0)