errors.go 409 B

123456789101112131415161718192021
  1. package iptc
  2. import (
  3. "fmt"
  4. "github.com/imgproxy/imgproxy/v3/ierrors"
  5. )
  6. type IptcError string
  7. func newIptcError(format string, args ...interface{}) error {
  8. return ierrors.Wrap(
  9. IptcError(fmt.Sprintf(format, args...)),
  10. 1,
  11. ierrors.WithStatusCode(422),
  12. ierrors.WithPublicMessage("Invalid IPTC data"),
  13. ierrors.WithShouldReport(false),
  14. )
  15. }
  16. func (e IptcError) Error() string { return string(e) }