Skip to content

Error Codes

All error responses follow a consistent JSON format:

{
"error": "Human-readable description of what went wrong",
"errorCode": "SNAKE_CASE_ERROR_CODE"
}

Some errors include additional fields with context (e.g., expectedVersion and actualVersion on concurrency conflicts).

Error CodeHTTP StatusDescription
VALIDATION_ERROR400Request validation failed — missing or invalid fields
INVALID_REQUEST400Malformed request body — could not parse JSON
INVALID_UPLOAD400File upload issue — missing file or wrong content type
INVALID_ZIP400Cannot extract zip contents
INVALID_CONTENTS400Zip missing required .cs files
FILE_TOO_LARGE400Upload exceeds 5MB limit
INVALID_REDUCER400Attempted to bind a projection as a reducer
REDUCER_NOT_READY400Reducer is still compiling — wait and retry
AGGREGATE_TYPE_MISMATCH400Aggregate already has events with a different type
UNAUTHORIZED401Invalid or missing API key
NOT_FOUND404Resource not found
NO_REDUCER_BOUND404No reducer configured for this aggregate type
CONCURRENCY_CONFLICT409Version mismatch — another process modified the aggregate
INTERNAL_ERROR500Server error — retry or contact support

Your request is invalid. Check the errorCode and error message for specifics. These are not retryable — fix the request and try again.

Your API key is missing, invalid, or expired. Check the X-API-Key header.

The resource doesn’t exist. For state queries, this can mean either the aggregate doesn’t exist or no reducer is bound — check the errorCode to distinguish (NOT_FOUND vs NO_REDUCER_BOUND).

The expectedVersion you specified doesn’t match the aggregate’s current version. Another process appended events since you last read the state.

{
"error": "Concurrency conflict",
"errorCode": "CONCURRENCY_CONFLICT",
"expectedVersion": 5,
"actualVersion": 7
}

The correct response is to reload the current state, re-evaluate your business logic, and retry with the new version.

Something went wrong on the server. These are safe to retry. If the problem persists, check the health endpoint.

The SDKs map these error codes to typed exceptions/errors automatically:

Error CodeSDK Exception
CONCURRENCY_CONFLICTHapndConcurrencyException
AGGREGATE_TYPE_MISMATCHHapndAggregateTypeMismatchException
VALIDATION_ERRORHapndValidationException
Other 4xx/5xxHapndApiException
Network failureHapndNetworkException
Error CodeSDK Error
CONCURRENCY_CONFLICTHapndConcurrencyError
AGGREGATE_TYPE_MISMATCHHapndAggregateTypeMismatchError
VALIDATION_ERRORHapndValidationError
Other 4xx/5xxHapndApiError
Network failureHapndNetworkError
Circuit breaker openHapndCircuitOpenError