GitIssues.ExceptionHandling 1.0.0

dotnet add package GitIssues.ExceptionHandling --version 1.0.0
                    
NuGet\Install-Package GitIssues.ExceptionHandling -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GitIssues.ExceptionHandling" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GitIssues.ExceptionHandling" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GitIssues.ExceptionHandling" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GitIssues.ExceptionHandling --version 1.0.0
                    
#r "nuget: GitIssues.ExceptionHandling, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GitIssues.ExceptionHandling@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GitIssues.ExceptionHandling&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GitIssues.ExceptionHandling&version=1.0.0
                    
Install as a Cake Tool

GitIssues.ExceptionHandling

NuGet

ASP.NET Core integration for GitIssues that automatically reports unhandled exceptions as GitHub Issues.

It plugs a GitHubExceptionHandler into ASP.NET Core's exception-handling middleware, so exceptions that reach it are reported to GitHub without any extra code in your controllers or endpoints.

Install

dotnet add package GitIssues.ExceptionHandling

This package depends on GitIssues, which is installed automatically.

Usage

First, register the core reporter (see the GitIssues README for all configuration options):

using GitHubErrorReporter.DependencyInjection;

builder.Services.AddGitHubErrorReporter(options =>
{
    options.Owner = builder.Configuration["GitHubIssues:Owner"]!;
    options.Repository = builder.Configuration["GitHubIssues:Repository"]!;
    options.Token = builder.Configuration["GitHubIssues:Token"]!;
    options.ServiceName = builder.Configuration["GitHubIssues:ServiceName"];
    options.Environment = builder.Environment.EnvironmentName;
});

Then register the exception handler:

using GitIssues.ExceptionHandling.Extensions;

builder.Services.AddGitIssuesExceptionHandler();

And enable the exception-handling middleware:

var app = builder.Build();

app.UseExceptionHandler();

app.MapControllers();

app.Run();

Now an unhandled exception, such as:

throw new InvalidOperationException("Something unexpected happened.");

will reach the exception handler and automatically create a GitHub Issue.

Handled vs. unhandled exceptions

This package only sees exceptions that reach the exception-handling middleware.

This exception is unhandled and will be picked up automatically:

throw new InvalidOperationException("Something went wrong.");

This exception is handled and will not be picked up, because it never reaches GitHubExceptionHandler:

try
{
    throw new InvalidOperationException("Something went wrong.");
}
catch (Exception ex)
{
    return StatusCode(500, ex.Message);
}

For handled exceptions, report them explicitly using the core GitIssues package from inside the catch block.

License

MIT

Product 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 was computed.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 44 9/16/2026