![]() |
VOOZH | about |
dotnet add package Franz.Common.Errors --version 2.2.7
NuGet\Install-Package Franz.Common.Errors -Version 2.2.7
<PackageReference Include="Franz.Common.Errors" Version="2.2.7" />
<PackageVersion Include="Franz.Common.Errors" Version="2.2.7" />Directory.Packages.props
<PackageReference Include="Franz.Common.Errors" />Project file
paket add Franz.Common.Errors --version 2.2.7
#r "nuget: Franz.Common.Errors, 2.2.7"
#:package Franz.Common.Errors@2.2.7
#addin nuget:?package=Franz.Common.Errors&version=2.2.7Install as a Cake Addin
#tool nuget:?package=Franz.Common.Errors&version=2.2.7Install as a Cake Tool
A library for handling and standardizing errors and exceptions in .NET applications. This library simplifies error management, making it easier to implement structured and meaningful error responses.
-Current Version: v2.2.7
ForbiddenExceptionFunctionalExceptionNotFoundExceptionPreconditionFailedExceptionTechnicalExceptionUnauthorizedExceptionExceptionBase for creating custom exceptions with consistent behavior.ErrorResponse for structuring API error responses.Install the package using NuGet Package Manager or the .NET CLI:
dotnet add package Franz.Common.Errors
Each exception is tailored for specific error scenarios. Here's an example of using NotFoundException:
using Franz.Common.Errors;
public void FindResource(int id)
{
var resource = GetResourceById(id);
if (resource == null)
{
throw new NotFoundException($"Resource with ID {id} was not found.");
}
}
Use ErrorResponse to provide consistent error information in your APIs:
using Franz.Common.Errors;
public IActionResult HandleException(Exception ex)
{
var errorResponse = new ErrorResponse
{
StatusCode = 500,
Message = ex.Message,
Details = "Additional details about the error."
};
return StatusCode(errorResponse.StatusCode, errorResponse);
}
Extend the ExceptionBase class to create your own exceptions with additional metadata:
using Franz.Common.Errors;
public class CustomException : ExceptionBase
{
public CustomException(string message) : base(message) { }
}
| Exception Type | Description |
|---|---|
ForbiddenException |
Use for actions the user is not permitted to perform. |
FunctionalException |
Represents a domain or business logic error. |
NotFoundException |
Indicates that a requested resource could not be found. |
PreconditionFailedException |
Indicates a failed precondition for the request. |
TechnicalException |
Represents an unexpected technical error. |
UnauthorizedException |
Indicates a lack of authorization to access a resource. |
We welcome contributions! Please follow these steps:
This library is licensed under the MIT License. See the LICENSE file for more details.
BananaRepublicException (EN/FR)MonsterException (EN/FR)VodkaCoffeePotException (EN/FR)FriendlyReminderException (EN/FR)TestExceptions static class| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Franz.Common.Errors:
| Package | Downloads |
|---|---|
|
Franz.Common.Reflection
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Business
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging
Shared utility library for the Franz Framework. |
|
|
Franz.Common.EntityFramework
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Http
Shared utility library for the Franz Framework. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.7 | 553 | 6/7/2026 |
| 2.2.6 | 561 | 6/6/2026 |
| 2.2.5 | 555 | 6/4/2026 |
| 2.2.4 | 541 | 6/3/2026 |
| 2.2.3 | 534 | 6/2/2026 |
| 2.2.2 | 536 | 6/2/2026 |
| 2.2.1 | 551 | 5/24/2026 |
| 2.1.4 | 440 | 4/27/2026 |
| 2.1.3 | 409 | 4/26/2026 |
| 2.1.2 | 414 | 4/26/2026 |
| 2.1.1 | 421 | 4/22/2026 |
| 2.0.2 | 432 | 3/30/2026 |
| 2.0.1 | 412 | 3/29/2026 |
| 1.7.8 | 438 | 3/2/2026 |
| 1.7.7 | 450 | 1/31/2026 |
| 1.7.6 | 461 | 1/22/2026 |
| 1.7.5 | 432 | 1/10/2026 |
| 1.7.4 | 443 | 12/27/2025 |
| 1.7.3 | 526 | 12/22/2025 |
| 1.7.2 | 521 | 12/21/2025 |