FirstClassErrors 0.1.0-preview.1
dotnet add package FirstClassErrors --version 0.1.0-preview.1
NuGet\Install-Package FirstClassErrors -Version 0.1.0-preview.1
<PackageReference Include="FirstClassErrors" Version="0.1.0-preview.1" />
<PackageVersion Include="FirstClassErrors" Version="0.1.0-preview.1" />
<PackageReference Include="FirstClassErrors" />
paket add FirstClassErrors --version 0.1.0-preview.1
#r "nuget: FirstClassErrors, 0.1.0-preview.1"
#:package FirstClassErrors@0.1.0-preview.1
#addin nuget:?package=FirstClassErrors&version=0.1.0-preview.1&prerelease
#tool nuget:?package=FirstClassErrors&version=0.1.0-preview.1&prerelease
FirstClassErrors
FirstClassErrors is a lightweight .NET library that turns exceptions into structured, documented, and diagnosable errors.
Instead of throwing ad-hoc messages, the library helps you define errors as explicit concepts with diagnostics and documentation directly in code.
It is especially useful for systems where supportability, troubleshooting, and operational clarity matter.
Key ideas
FirstClassErrors allows you to:
- define structured errors with stable error codes
- attach diagnostics and investigation leads
- keep error documentation close to the code
- generate human-readable documentation automatically
Errors become documented knowledge about your system, not just runtime failures.
Example
return DescribeError.WithTitle("Temperature below absolute zero")
.WithDescription("This error occurs when trying to instantiate a temperature with a value that is below absolute zero.")
.WithRule("Temperature cannot go below absolute zero because absolute zero is the point where particles have minimum possible energy.")
.WithDiagnostics(ValueObjectDiagnostic.Diagnostic)
.WithExamples(
() => BelowAbsoluteZero(-1, TemperatureUnit.Kelvin),
() => BelowAbsoluteZero(-280, TemperatureUnit.Celsius));
This produces structured documentation tied directly to the error definition.
When to use FirstClassErrors
This library is particularly useful when:
- building complex business systems
- designing domain-driven models
- improving error observability
- supporting production troubleshooting
- generating living documentation from code
Documentation
Full documentation and guides are available on GitHub:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FirstClassErrors:
| Package | Downloads |
|---|---|
|
FirstClassErrors.Testing
Testing helpers for FirstClassErrors: fluent, framework-agnostic assertions on Outcome and Error, plus a freezable clock and instance ids so an error's OccurredAt and InstanceId become deterministic in your tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.1 | 212 | 7/12/2026 |
Initial preview release of FirstClassErrors.