Table of Contents

Class RateLimitError

Namespace
FunctionalDdd
Assembly
FunctionalDdd.RailwayOrientedProgramming.dll

Represents a rate limiting error when too many requests have been made. Use this when a client has exceeded their request quota or rate limit. Maps to HTTP 429 Too Many Requests.

public sealed class RateLimitError : Error, IEquatable<Error>
Inheritance
RateLimitError
Implements
Inherited Members
Extension Methods

Examples

Error.RateLimit("API rate limit exceeded. Please try again in 60 seconds")
Error.RateLimit("Daily quota of 1000 requests exceeded", userId)
Error.RateLimit("Too many login attempts. Account temporarily locked")

Remarks

Include retry-after information in the detail message when appropriate. Consider adding custom properties for RetryAfter seconds if needed for your API design.

Constructors

RateLimitError(string, string, string?)

Initializes a new instance of the RateLimitError class.

public RateLimitError(string detail, string code, string? instance = null)

Parameters

detail string

Description of the rate limit violation.

code string

The error code identifying this type of rate limit error.

instance string

Optional identifier for the client or resource being rate limited.