diff --git a/README.md b/README.md index 8a22da1..a780e70 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ A demo of AOP Exception Handling. - [Callback Method](#callback-method) - [Finally](#finally) - [Logging](#logging) + - [Message](#message) - [Examples](#examples) - [Contributing](#contributing) - [License](#license) @@ -218,6 +219,22 @@ protected virtual async Task SomeMethod(string message) } ``` +### Message + +You may set customised message for the exception. For example: +```csharp +[ExceptionHandler(typeof(Exception), + Message = "Customised message", + TargetType = typeof(BookAppService), + MethodName = nameof(HandleException))] +protected virtual async Task SomeMethod(string message) +{ + throw new Exception("boo!"); + return false; +} +``` +This would output "Customised message" along with the exception message. + ## Examples Example with multiple exception handler: