Skip to content

JinxSeven/EZXception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Never write another custom exception class ever again.

EZXception

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.

Get Started

dotnet add package EZXception --version 1.0.0

Documentation

Naming Notes

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

License

MIT

About

Never write another custom exception ever again. 50+ pre-built, richly structured exception types covering every scenario a .NET developer encounters.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages