mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-12-23 22:11:10 +02:00
* Refactored errors * Make monitoring and errorreport accept `errctx.Error` instead of `error` * Add server.Error; Remove category from errctx; Make HTTP handlers respond with *server.Error * Remove stackSkip from errctx.Wrap; Add errctx.WrapWithStackSkip
20 lines
398 B
Go
20 lines
398 B
Go
package workers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
|
)
|
|
|
|
type TooManyRequestsError struct{ *errctx.TextError }
|
|
|
|
func newTooManyRequestsError() error {
|
|
return TooManyRequestsError{errctx.NewTextError(
|
|
"Too many requests",
|
|
1,
|
|
errctx.WithStatusCode(http.StatusTooManyRequests),
|
|
errctx.WithPublicMessage("Too many requests"),
|
|
errctx.WithShouldReport(false),
|
|
)}
|
|
}
|