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
24 lines
519 B
Go
24 lines
519 B
Go
package processing
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
|
"github.com/imgproxy/imgproxy/v3/imagetype"
|
|
)
|
|
|
|
type (
|
|
SaveFormatError struct{ *errctx.TextError }
|
|
)
|
|
|
|
func newSaveFormatError(format imagetype.Type) error {
|
|
return SaveFormatError{errctx.NewTextError(
|
|
fmt.Sprintf("Can't save %s, probably not supported by your libvips", format),
|
|
1,
|
|
errctx.WithStatusCode(http.StatusUnprocessableEntity),
|
|
errctx.WithPublicMessage("Invalid URL"),
|
|
errctx.WithShouldReport(false),
|
|
)}
|
|
}
|