errors.go 493 B

12345678910111213141516171819202122232425262728
  1. package vips
  2. import (
  3. "fmt"
  4. "github.com/imgproxy/imgproxy/v3/ierrors"
  5. )
  6. type (
  7. VipsError string
  8. ColorError string
  9. )
  10. func newVipsError(msg string) error {
  11. return ierrors.Wrap(VipsError(msg), 1)
  12. }
  13. func (e VipsError) Error() string { return string(e) }
  14. func newColorError(format string, args ...interface{}) error {
  15. return ierrors.Wrap(
  16. ColorError(fmt.Sprintf(format, args...)),
  17. 1,
  18. ierrors.WithShouldReport(false),
  19. )
  20. }
  21. func (e ColorError) Error() string { return string(e) }