From 0e2167f12e45ab49ade8d4cf83aaf4c019b3ad4e Mon Sep 17 00:00:00 2001 From: William Matthews Date: Thu, 25 Jul 2024 08:57:57 +0000 Subject: [PATCH] add request too large --- error.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/error.go b/error.go index 32648ea..460ad7d 100644 --- a/error.go +++ b/error.go @@ -16,6 +16,8 @@ const ( ErrTypePermission ErrType = "permission_error" // ErrTypeNotFound The requested resource was not found. ErrTypeNotFound ErrType = "not_found_error" + // ErrTypeTooLarge Request exceeds the maximum allowed number of bytes. + ErrTypeTooLarge ErrType = "request_too_large" // ErrTypeRateLimit Your account has hit a rate limit. ErrTypeRateLimit ErrType = "rate_limit_error" // ErrTypeApi An unexpected error has occurred internal to Anthropic's systems. @@ -50,6 +52,10 @@ func (e *APIError) IsNotFoundErr() bool { return e.Type == ErrTypeNotFound } +func (e *APIError) IsTooLargeErr() bool { + return e.Type == ErrTypeTooLarge +} + func (e *APIError) IsRateLimitErr() bool { return e.Type == ErrTypeRateLimit }