Innovabit.DotNet.Interceptors.Notifications.Abstractions
1.0.0.96
dotnet add package Innovabit.DotNet.Interceptors.Notifications.Abstractions --version 1.0.0.96
NuGet\Install-Package Innovabit.DotNet.Interceptors.Notifications.Abstractions -Version 1.0.0.96
<PackageReference Include="Innovabit.DotNet.Interceptors.Notifications.Abstractions" Version="1.0.0.96" />
<PackageVersion Include="Innovabit.DotNet.Interceptors.Notifications.Abstractions" Version="1.0.0.96" />
<PackageReference Include="Innovabit.DotNet.Interceptors.Notifications.Abstractions" />
paket add Innovabit.DotNet.Interceptors.Notifications.Abstractions --version 1.0.0.96
#r "nuget: Innovabit.DotNet.Interceptors.Notifications.Abstractions, 1.0.0.96"
#:package Innovabit.DotNet.Interceptors.Notifications.Abstractions@1.0.0.96
#addin nuget:?package=Innovabit.DotNet.Interceptors.Notifications.Abstractions&version=1.0.0.96
#tool nuget:?package=Innovabit.DotNet.Interceptors.Notifications.Abstractions&version=1.0.0.96
Innovabit.DotNet.Interceptors.Notifications.Abstractions
Send notifications when an intercepted method throws, for the
Innovabit.DotNet.Interceptors
suite. This is the base package; add a channel
(...Notifications.Slack and/or ...Notifications.Email) to actually deliver them.
What it provides
[NotifyOnException]— dispatch a notification when a method (or any method of a class) throws.INotifier— a delivery channel abstraction (Slack, e-mail, ...).IExceptionNotificationHandler/ExceptionNotificationHandler<TException>— build the message per exception type, with a generic fallback forSystem.Exception.INotificationDispatcher— picks the most specific handler and fans the message out to every matching channel.- Templates —
AddTemplates()plus template sources (code, files, embedded resources) so the wording lives outside the code, with a channel specific variant per notifier. INotificationSender— send a notification (templated or not) on demand, outside the exception pipeline.
Install
dotnet add package Innovabit.DotNet.Interceptors.Notifications.Abstractions
Usage
services.AddInterceptors()
.AddNotifications()
.AddSlack(o => o.WebhookUrl = "https://hooks.slack.com/services/XXX/YYY/ZZZ")
.AddHandler<TimeoutExceptionNotificationHandler>();
public class OrderService : IOrderService
{
[NotifyOnException] // notify (all channels) then re-throw
public Task PlaceAsync(Order order) { ... }
}
[NotifyOnException] supports Rethrow, Severity, Channels, ExceptionTypes and
Template. Register a handler for a concrete exception type by deriving from
ExceptionNotificationHandler<TException>; the most specific match wins, falling back to
the handler for System.Exception.
Templates
Move the wording out of the code and give every channel its own version — a rich HTML e-mail and a one-line Slack message out of the same failure:
services.AddInterceptors()
.AddNotifications()
.AddTemplates(o => o.DefaultTemplateName = "house-style")
.AddTemplatesFromDirectory("Templates") // {name}[.{channel}].{txt|html}
.AddTemplatesFromAssembly() // embedded resources
.AddTemplate("order-failed", // ... or in code
title: "Order failed in {{ Member }}",
body: "{{ ExceptionMessage }} at {{ OccurredAt:yyyy-MM-dd HH:mm }}");
[NotifyOnException(Template = "order-failed")]
public Task PlaceAsync(Order order) { ... }
Templates/order-failed.Email.html:
<h1>{{ ExceptionType }}</h1>
<p>{{ ExceptionMessage }}</p>
The built-in renderer substitutes {{ Path }} placeholders (dotted paths, an optional
:format specifier, HTML-encoded in HTML templates). Add
Innovabit.DotNet.Interceptors.Notifications.Templating.Scriban when the wording needs
conditionals, loops or filters.
The model of an exception notification exposes Exception, Method, TargetType,
Arguments, OccurredAt, Severity and the shortcuts ExceptionType,
ExceptionMessage, StackTrace, Member and MachineName.
Sending on demand
The same channels and templates are available outside the exception pipeline:
public class WelcomeService(INotificationSender sender)
{
public Task WelcomeAsync(Customer customer)
=> sender.SendTemplateAsync("welcome", new { customer.Name, customer.OrderId });
}
Unlike the exception dispatcher — which swallows channel failures so a broken mail server
never changes how a method fails — an explicit send attempts every channel and throws an
AggregateException with whatever went wrong.
Part of
The Innovabit.DotNet.Interceptors suite —
github.com/Innovabit/dotnet-interceptors.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Innovabit.DotNet.Interceptors.Abstractions (>= 1.0.0.96)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
-
net8.0
- Innovabit.DotNet.Interceptors.Abstractions (>= 1.0.0.96)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
-
net9.0
- Innovabit.DotNet.Interceptors.Abstractions (>= 1.0.0.96)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Innovabit.DotNet.Interceptors.Notifications.Abstractions:
| Package | Downloads |
|---|---|
|
Innovabit.DotNet.Interceptors.Notifications.Email
E-mail (SMTP) channel for exception notifications using interceptor. |
|
|
Innovabit.DotNet.Interceptors.Notifications.Slack
Slack channel for exception notifications using interceptor. |
|
|
Innovabit.DotNet.Interceptors.Notifications.Templating.Scriban
Scriban template engine for the notification templates of Innovabit.DotNet.Interceptors. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.96 | 142 | 9/12/2026 |
| 1.0.0.95 | 183 | 9/5/2026 |
| 1.0.0.94 | 127 | 9/5/2026 |
| 1.0.0.93 | 126 | 9/5/2026 |
| 1.0.0.90 | 167 | 8/17/2026 |
| 1.0.0.89 | 140 | 8/15/2026 |
| 1.0.0.88 | 140 | 8/15/2026 |
| 1.0.0.87 | 131 | 8/13/2026 |
| 1.0.0.86 | 150 | 8/13/2026 |
| 1.0.0.85 | 124 | 8/13/2026 |
| 1.0.0.84 | 130 | 8/13/2026 |
| 1.0.0.83 | 122 | 8/13/2026 |
| 1.0.0.82 | 123 | 8/13/2026 |
| 1.0.0.81 | 129 | 8/13/2026 |
| 1.0.0.80 | 146 | 8/12/2026 |
| 1.0.0.79 | 129 | 8/12/2026 |
| 1.0.0.78 | 134 | 8/12/2026 |
| 1.0.0.77 | 126 | 8/12/2026 |
| 1.0.0.76 | 128 | 8/12/2026 |
| 1.0.0.75 | 135 | 8/12/2026 |