Enum ErrorCode
- Namespace
- CivitaiSharp.Core.Response
- Assembly
- CivitaiSharp.Core.dll
Categorized error codes for operations across the CivitaiSharp libraries.
public enum ErrorCode
- Extension Methods
Fields
BadGateway = 106The server returned a bad gateway response (502).
BadRequest = 102The server returned a bad request (400) response.
CloudflareError = 503The response was a Cloudflare error page, indicating the origin server is unreachable or blocked. This typically occurs during Civitai outages, DDoS protection triggers, or when rate limited at the CDN level.
Conflict = 104A conflict occurred with the current state of the resource (409).
DeserializationFailed = 500Failed to deserialize a response from JSON.
DirectoryCreationFailed = 605Failed to create a directory.
DownloadUrlMissing = 607The download URL is missing or null.
EmptyResponse = 501The response was empty or null when data was expected.
FileNotFound = 600The specified file was not found.
FileWriteFailed = 604Failed to write data to a file.
Forbidden = 201The authenticated user lacks permission for this operation (403).
GatewayTimeout = 108The gateway timed out waiting for a response (504).
HashComputationFailed = 603A hash computation operation failed.
HashVerificationFailed = 606Hash verification failed because the computed hash does not match the expected hash.
HttpError = 100A general HTTP communication error occurred.
HttpVersionNotSupported = 118The HTTP version used in the request is not supported (505).
ImageUrlMissing = 608The image URL is missing or null.
InsufficientCredits = 202The account has insufficient credits to complete the operation (402).
InvalidParameter = 401A required parameter was missing or invalid.
InvalidUrl = 400A provided URL was invalid or malformed.
IoError = 601A file I/O operation failed.
LoopDetected = 119A loop was detected while processing the request (508).
MethodNotAllowed = 109The HTTP method is not allowed for the requested resource (405).
MovedPermanently = 112The resource has been permanently moved to a new location (301).
NoContent = 111The request was successful but the response contains no content (204).
NotAcceptable = 110The server cannot produce a response matching the Accept headers (406).
NotFound = 103The requested resource was not found (404).
NotImplemented = 117The server does not support the requested functionality (501).
PatternValidationFailed = 609A path pattern contains invalid tokens or is malformed.
PermanentRedirect = 114The resource has been permanently redirected (308).
RateLimited = 300Too many requests have been made; rate limit exceeded (429).
RequestHeaderFieldsTooLarge = 116The request header fields are too large (431).
A requested resource is not available or not ready.
ServerError = 105The server encountered an internal error (500).
The service is temporarily unavailable (503).
StreamNotReadable = 602A stream was not readable when read access was required.
TemporaryRedirect = 113The resource has been temporarily redirected (307).
Timeout = 101The HTTP request timed out before completing.
Authentication failed or credentials are missing/invalid (401).
The resource is unavailable for legal reasons (451).
UnexpectedContentType = 502The response was not in JSON format (possibly an HTML response).
Unknown = 0An unknown or unclassified error occurred.
ValidationFailed = 402Request validation failed. Check Details for field-level errors.
Remarks
Error codes are organized by category using numeric ranges:
- 0-99: General/Unknown errors
- 100-199: HTTP and network errors
- 200-299: Authentication and authorization errors
- 300-399: Rate limiting and quota errors
- 400-499: Validation and input errors
- 500-599: Serialization and parsing errors
- 600-699: File and I/O errors
- 700-799: Resource state errors