Exprivia.AsteStg.ErrorReporting.Core
1.0.3
dotnet add package Exprivia.AsteStg.ErrorReporting.Core --version 1.0.3
NuGet\Install-Package Exprivia.AsteStg.ErrorReporting.Core -Version 1.0.3
<PackageReference Include="Exprivia.AsteStg.ErrorReporting.Core" Version="1.0.3" />
<PackageVersion Include="Exprivia.AsteStg.ErrorReporting.Core" Version="1.0.3" />
<PackageReference Include="Exprivia.AsteStg.ErrorReporting.Core" />
paket add Exprivia.AsteStg.ErrorReporting.Core --version 1.0.3
#r "nuget: Exprivia.AsteStg.ErrorReporting.Core, 1.0.3"
#:package Exprivia.AsteStg.ErrorReporting.Core@1.0.3
#addin nuget:?package=Exprivia.AsteStg.ErrorReporting.Core&version=1.0.3
#tool nuget:?package=Exprivia.AsteStg.ErrorReporting.Core&version=1.0.3
Exprivia.AsteStg.ErrorReporting.Core
Astrazioni condivise per la segnalazione centralizzata degli errori nell'ecosistema AsteSTG, senza alcuna dipendenza da Blazor: può essere usata sia da applicazioni Blazor sia da Web API/servizi backend.
Contenuto del pacchetto
IErrorReporter— contratto per l'invio di una segnalazione di errore.ErrorReport— record immutabile con i dati della segnalazione (ID,DATA_ORA,IP_MACCHINA,PROCESSO,ASSEMBLY,METODO,MESSAGGIO).ErrorReportBuilder— helper statico che costruisce unErrorReporta partire da un'Exception, risolvendo automaticamente IP macchina, processo corrente e stack trace.
Installazione
dotnet add package Exprivia.AsteStg.ErrorReporting.Core
Utilizzo
Implementare IErrorReporter con la logica di invio desiderata (log su DB, chiamata a un servizio, ecc.) e registrarlo nel container DI dell'applicazione ospitante:
public sealed class MyErrorReporter : IErrorReporter
{
public async Task ReportAsync(Exception exception, string? context = null, CancellationToken ct = default)
{
var report = ErrorReportBuilder.Build(exception, context);
// persistere / inviare 'report'
}
}
builder.Services.AddScoped<IErrorReporter, MyErrorReporter>();
Target Framework
net10.0
Pacchetti correlati
Exprivia.AsteStg.ErrorReporting.Blazor— componenteGlobalErrorBoundaryper app Blazor basato su questo pacchetto.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Exprivia.AsteStg.ErrorReporting.Core:
| Package | Downloads |
|---|---|
|
Exprivia.AsteStg.ErrorReporting.Blazor
Componente GlobalErrorBoundary pronto all'uso per app Blazor: intercetta automaticamente le eccezioni non gestite dei componenti figli, le inoltra a un IErrorReporter (da Exprivia.AsteStg.ErrorReporting.Core) registrato dall'app ospitante, mostra una notifica MudBlazor all'utente e ripristina il componente senza bloccare l'interfaccia. Come si usa: 1. Registra MudBlazor (services.AddMudServices()) e un'implementazione di IErrorReporter nel DI dell'app ospitante. 2. Aggiungi MudSnackbarProvider nel layout principale. 3. Racchiudi il Router (o la sezione da proteggere) nel componente: <GlobalErrorBoundary><Router ... /></GlobalErrorBoundary>. Richiede i pacchetti Exprivia.AsteStg.ErrorReporting.Core e MudBlazor. |
GitHub repositories
This package is not used by any popular GitHub repositories.