Never write another custom exception class ever again.❌
EZXception is a netstandard2.0 library that ships 50+ pre-built, richly structured exception types covering every scenario a .NET developer encounters - validation, authorization, data access, business rules, configuration, external services, file I/O, networking, serialization, concurrency, and domain modeling.
Instead of writing this every time:
public class UserNotFoundException : Exception
{
public UserNotFoundException(string id)
: base($"User '{id}' was not found.") { }
}You just do this:
throw new EntityNotFoundException("User", id);Every exception carries typed contextual properties (entity name, field name, status code, timeout, etc.) so catch blocks can read structured data instead of parsing message strings.
dotnet add package EZXception --version 1.0.0- Setup & Installation
- Validation
- Authorization
- Data
- Business
- Domain
- Configuration
- External Service
- IO
- Network
- Serialization
- Concurrency
Three exceptions carry an EZ prefix to avoid compile-time ambiguity with identically named BCL types:
| EZXception type | Would shadow |
|---|---|
EZXception.IO.EZFileNotFoundException |
System.IO.FileNotFoundException |
EZXception.IO.EZDirectoryNotFoundException |
System.IO.DirectoryNotFoundException |
EZXception.Serialization.EZSerializationException |
System.Runtime.Serialization.SerializationException |
MIT