Levge.Exceptions 1.1.43

dotnet add package Levge.Exceptions --version 1.1.43
                    
NuGet\Install-Package Levge.Exceptions -Version 1.1.43
                    
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="Levge.Exceptions" Version="1.1.43" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Levge.Exceptions" Version="1.1.43" />
                    
Directory.Packages.props
<PackageReference Include="Levge.Exceptions" />
                    
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 Levge.Exceptions --version 1.1.43
                    
#r "nuget: Levge.Exceptions, 1.1.43"
                    
#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 Levge.Exceptions@1.1.43
                    
#: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=Levge.Exceptions&version=1.1.43
                    
Install as a Cake Addin
#tool nuget:?package=Levge.Exceptions&version=1.1.43
                    
Install as a Cake Tool

<img src="src/Levge.Exceptions/icon.png" width="100" height="100" alt="Levge.Exceptions logo" />

Levge.Exceptions

NuGet Build

🌐 Read in Turkish languages


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 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.
  • 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.

Version Downloads Last Updated
1.1.43 221 6/24/2025
1.1.42 142 6/24/2025
1.1.41 219 6/22/2025
1.1.31 99 6/21/2025
1.1.1 101 6/21/2025
1.1.0 379 6/17/2025
1.0.1 179 6/17/2025
1.0.0 244 6/16/2025