Skip to Content

Errors

The Memorer SDK raises typed exceptions for different error conditions.

Exception hierarchy

All exceptions inherit from MemorerError:

ExceptionHTTP StatusDescription
MemorerErrorAnyBase exception for all SDK errors
AuthenticationError401Invalid or missing API key
AuthorizationError403Insufficient permissions
NotFoundError404Resource doesn’t exist
ValidationError400Invalid request parameters
ConflictError409Resource conflict (e.g. duplicate)
RateLimitError429Rate limit exceeded
ServerError5xxServer-side error
NetworkErrorNetwork connectivity issue
StreamingErrorStreaming response failure

MemorerError attributes

All exceptions have these attributes:

AttributeTypeDescription
messagestrHuman-readable error message
status_codeint | NoneHTTP status code (None for network errors)
detailstr | NoneAdditional detail from the API
responseAnyRaw response object

RateLimitError

RateLimitError has an additional attribute:

AttributeTypeDescription
retry_afterint | NoneSeconds to wait before retrying

HTTP status codes

CodeDescription
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing API key
403Forbidden — Insufficient permissions
404Not Found — Resource doesn’t exist
409Conflict — Resource already exists
429Too Many Requests — Rate limit exceeded
5xxServer Error — Internal server error

Error codes

CodeHTTP StatusDescription
invalid_api_key401The API key is invalid or expired
missing_api_key401No API key provided
memory_not_found404The memory ID doesn’t exist
entity_not_found404The entity ID doesn’t exist
conversation_not_found404The conversation ID doesn’t exist
rate_limit_exceeded429Too many requests, try again later
content_too_large400Content exceeds maximum size
invalid_owner_id400Owner ID format is invalid

Rate limits

PlanRequests/minuteMemories/month
Free601,000
Pro60050,000
EnterpriseCustomCustom

Handling errors in Python

from memorer import Memorer from memorer.errors import MemorerError, RateLimitError, NotFoundError client = Memorer(api_key="mem_sk_...") user = client.for_user("user-123") try: result = user.remember("Some content") except RateLimitError as e: print(f"Rate limited. Retry after {e.retry_after} seconds") except NotFoundError as e: print(f"Not found: {e.message}") except MemorerError as e: print(f"API error ({e.status_code}): {e.message}") if e.detail: print(f" Detail: {e.detail}")
Last updated on