API Reference ErrorCategory - ulfbou/Zentient.Results GitHub Wiki
enum
โ Zentient.Results.ErrorCategory
๐ API Reference: Namespace:
Zentient.Results
Assembly:Zentient.Results.dll
Available since:v0.1.0
๐ Summary
Represents structured error categories that define the semantic nature of a failure. This enum enables strong typing and consistent error classification across result handling, logging, observability, and transport-layer mappings (e.g., HTTP status codes).
Used extensively within the
IError
model and its derivatives to support error routing, telemetry tagging, and adaptive behavior in endpoints and handlers.
๐ Type Signature
public enum ErrorCategory
๐ Members
Member Name | Value | Description |
---|---|---|
None |
0 |
No specific error category. Default value. |
General |
1 |
General, uncategorized error. |
Validation |
2 |
Invalid or missing input data. |
Authentication |
3 |
Failed authentication, e.g. invalid credentials. |
Authorization |
4 |
Authenticated but lacks permissions. |
NotFound |
5 |
Resource not found. |
Conflict |
6 |
State or resource conflict. |
Exception |
7 |
Unhandled exception during execution. |
Network |
8 |
Communication or connectivity failure. |
Database |
9 |
Database-related error, including constraint violations. |
Timeout |
10 |
Operation exceeded time limits. |
Security |
11 |
Security policy violation or vulnerability. |
Request |
12 |
Malformed client request. |
Concurrency |
13 |
Concurrent access or optimistic concurrency violation. |
TooManyRequests |
14 |
Client rate-limiting triggered. |
ExternalService |
15 |
Upstream service dependency failed. |
BusinessLogic |
16 |
Domain rules violated. |
ResourceGone |
17 |
Previously existing resource is now removed. |
NotImplemented |
18 |
Feature or operation not yet implemented. |
InternalServerError |
19 |
Catch-all for unexpected server-side failure. |
ServiceUnavailable |
20 |
Temporarily unavailable due to overload or maintenance. |
ProblemDetails |
21 |
General problem details schema issue. |
RateLimit |
22 |
Exceeded rate limit quota. |
๐งช Usage Example
var error = Error.Create(
category: ErrorCategory.Validation,
message: "Email address is missing."
);
โ ๏ธ Remarks
- This enum is designed to be transport-agnostic yet transport-aligned: each category can be mapped to HTTP/gRPC equivalents, aiding in protocol-level error handling.
- Use
General
for unknown errors only as a fallback. InternalServerError
is often used as a last-resort categorization and may be treated differently in observability pipelines.
๐ See Also
๐ท๏ธ Tags
#API
#ErrorModel
#Enum
#ZentientCore
#StableContract
Last Updated: 2025-06-21 Version: 0.4.0