2025-09-11 17:29:43 +03:00
|
|
|
package workers
|
2025-08-26 16:19:41 +02:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
|
2025-11-20 01:26:21 +06:00
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
2025-08-26 16:19:41 +02:00
|
|
|
)
|
|
|
|
|
|
2025-11-20 01:26:21 +06:00
|
|
|
type TooManyRequestsError struct{ *errctx.TextError }
|
2025-08-26 16:19:41 +02:00
|
|
|
|
|
|
|
|
func newTooManyRequestsError() error {
|
2025-11-20 01:26:21 +06:00
|
|
|
return TooManyRequestsError{errctx.NewTextError(
|
|
|
|
|
"Too many requests",
|
2025-08-26 16:19:41 +02:00
|
|
|
1,
|
2025-11-20 01:26:21 +06:00
|
|
|
errctx.WithStatusCode(http.StatusTooManyRequests),
|
|
|
|
|
errctx.WithPublicMessage("Too many requests"),
|
|
|
|
|
errctx.WithShouldReport(false),
|
|
|
|
|
)}
|
2025-08-26 16:19:41 +02:00
|
|
|
}
|