Table of Contents

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 = 106

The server returned a bad gateway response (502).

BadRequest = 102

The server returned a bad request (400) response.

CloudflareError = 503

The 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 = 104

A conflict occurred with the current state of the resource (409).

DeserializationFailed = 500

Failed to deserialize a response from JSON.

DirectoryCreationFailed = 605

Failed to create a directory.

DownloadUrlMissing = 607

The download URL is missing or null.

EmptyResponse = 501

The response was empty or null when data was expected.

FileNotFound = 600

The specified file was not found.

FileWriteFailed = 604

Failed to write data to a file.

Forbidden = 201

The authenticated user lacks permission for this operation (403).

GatewayTimeout = 108

The gateway timed out waiting for a response (504).

HashComputationFailed = 603

A hash computation operation failed.

HashVerificationFailed = 606

Hash verification failed because the computed hash does not match the expected hash.

HttpError = 100

A general HTTP communication error occurred.

HttpVersionNotSupported = 118

The HTTP version used in the request is not supported (505).

ImageUrlMissing = 608

The image URL is missing or null.

InsufficientCredits = 202

The account has insufficient credits to complete the operation (402).

InvalidParameter = 401

A required parameter was missing or invalid.

InvalidUrl = 400

A provided URL was invalid or malformed.

IoError = 601

A file I/O operation failed.

LoopDetected = 119

A loop was detected while processing the request (508).

MethodNotAllowed = 109

The HTTP method is not allowed for the requested resource (405).

MovedPermanently = 112

The resource has been permanently moved to a new location (301).

NoContent = 111

The request was successful but the response contains no content (204).

NotAcceptable = 110

The server cannot produce a response matching the Accept headers (406).

NotFound = 103

The requested resource was not found (404).

NotImplemented = 117

The server does not support the requested functionality (501).

PatternValidationFailed = 609

A path pattern contains invalid tokens or is malformed.

PermanentRedirect = 114

The resource has been permanently redirected (308).

RateLimited = 300

Too many requests have been made; rate limit exceeded (429).

RequestHeaderFieldsTooLarge = 116

The request header fields are too large (431).

ResourceUnavailable = 700

A requested resource is not available or not ready.

ServerError = 105

The server encountered an internal error (500).

ServiceUnavailable = 107

The service is temporarily unavailable (503).

StreamNotReadable = 602

A stream was not readable when read access was required.

TemporaryRedirect = 113

The resource has been temporarily redirected (307).

Timeout = 101

The HTTP request timed out before completing.

Unauthorized = 200

Authentication failed or credentials are missing/invalid (401).

UnavailableForLegalReasons = 115

The resource is unavailable for legal reasons (451).

UnexpectedContentType = 502

The response was not in JSON format (possibly an HTML response).

Unknown = 0

An unknown or unclassified error occurred.

ValidationFailed = 402

Request 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