mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-29 04:53:05 +02:00
Don't report context cancelled
errors to metrics collectors
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Change
|
||||||
|
- Don't report `The image request is cancelled` errors.
|
||||||
|
|
||||||
## [3.18.2] - 2023-07-13
|
## [3.18.2] - 2023-07-13
|
||||||
### Fix
|
### Fix
|
||||||
|
@@ -167,7 +167,7 @@ func respondWithNotModified(reqID string, r *http.Request, rw http.ResponseWrite
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendErrAndPanic(ctx context.Context, errType string, err error) {
|
func sendErr(ctx context.Context, errType string, err error) {
|
||||||
send := true
|
send := true
|
||||||
|
|
||||||
if ierr, ok := err.(*ierrors.Error); ok {
|
if ierr, ok := err.(*ierrors.Error); ok {
|
||||||
@@ -183,7 +183,10 @@ func sendErrAndPanic(ctx context.Context, errType string, err error) {
|
|||||||
if send {
|
if send {
|
||||||
metrics.SendError(ctx, errType, err)
|
metrics.SendError(ctx, errType, err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func sendErrAndPanic(ctx context.Context, errType string, err error) {
|
||||||
|
sendErr(ctx, errType, err)
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,7 +332,7 @@ func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
|
|||||||
errorreport.Report(err, r)
|
errorreport.Report(err, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics.SendError(ctx, "download", err)
|
sendErr(ctx, "download", err)
|
||||||
|
|
||||||
if imagedata.FallbackImage == nil {
|
if imagedata.FallbackImage == nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Reference in New Issue
Block a user