Levge.Exceptions
1.1.43
dotnet add package Levge.Exceptions --version 1.1.43
NuGet\Install-Package Levge.Exceptions -Version 1.1.43
<PackageReference Include="Levge.Exceptions" Version="1.1.43" />
<PackageVersion Include="Levge.Exceptions" Version="1.1.43" />
<PackageReference Include="Levge.Exceptions" />
paket add Levge.Exceptions --version 1.1.43
#r "nuget: Levge.Exceptions, 1.1.43"
#:package Levge.Exceptions@1.1.43
#addin nuget:?package=Levge.Exceptions&version=1.1.43
#tool nuget:?package=Levge.Exceptions&version=1.1.43
<img src="src/Levge.Exceptions/icon.png" width="100" height="100" alt="Levge.Exceptions logo" />
Levge.Exceptions
Levge.Exceptions
is a lightweight library providing custom exception types for consistent error handling across all Levge packages.
Features
- ? Standardized exceptions — unified error handling across applications
- ? Specialized exception types — different exceptions for different error scenarios
- ? Simple and expressive API — easily create meaningful error messages
Installation
.NET CLI
dotnet add package Levge.Exceptions
Package Manager
Install-Package Levge.Exceptions
Setup
No specific setup is required. Simply reference the package and start using the exception types in your code.
Usage
// Basic usage with message throw new LevgeException("Something went wrong");
// Not found exception with resource information throw new LevgeNotFoundException("User", 123);
// Conflict exception for a specific field throw LevgeConflictException.ForField("Email", "user@example.com");
// Validation exception with multiple errors var errors = new Dictionary<string, string[]> { { "Username", new[] { "Username is required" } }, { "Email", new[] { "Invalid email format", "Email domain not allowed" } } }; throw new LevgeValidationException(errors);
// Unauthorized exception throw new LevgeUnauthorizedException();
Available Exception Types
Exception Type | Description |
---|---|
LevgeException |
Base exception for all Levge-specific exceptions |
LevgeNotFoundException |
Thrown when a requested resource cannot be found |
LevgeConflictException |
Thrown when a resource conflict occurs (e.g., duplicate entry) |
LevgeUnauthorizedException |
Thrown when a user lacks permission for an action |
LevgeValidationException |
Thrown when input validation fails with detailed error information |
License
MIT License. See LICENSE for details.
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 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. |
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Levge.Exceptions:
Package | Downloads |
---|---|
Levge.Identity
Identity and authentication services for .NET applications. |
|
Levge.Domain
Domain entity, interface, and enumeration base types for Levge projects. |
|
Levge.ConsistentResponse
A library for standardizing API responses in ASP.NET Core applications with consistent formatting, error handling, and exception middleware. |
GitHub repositories
This package is not used by any popular GitHub repositories.