Skip to content

Commit

Permalink
Merge pull request #3 from WillMatthews/add-request-too-large
Browse files Browse the repository at this point in the history
add request too large error
  • Loading branch information
liushuangls committed Jul 25, 2024
2 parents 6e9b64e + 0e2167f commit 5d42062
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5d42062

Please sign in to comment.