errors.go 430 B

1234567891011121314151617181920212223
  1. package generichttp
  2. import (
  3. "net/http"
  4. "github.com/imgproxy/imgproxy/v3/ierrors"
  5. )
  6. type (
  7. SourceAddressError string
  8. )
  9. func newSourceAddressError(msg string) error {
  10. return ierrors.Wrap(
  11. SourceAddressError(msg),
  12. 1,
  13. ierrors.WithStatusCode(http.StatusNotFound),
  14. ierrors.WithPublicMessage("Invalid source URL"),
  15. ierrors.WithShouldReport(false),
  16. )
  17. }
  18. func (e SourceAddressError) Error() string { return string(e) }