2025-02-17 22:11:40 +03:00
|
|
|
package vips
|
|
|
|
|
|
|
|
import (
|
2025-02-18 17:35:13 +03:00
|
|
|
"fmt"
|
|
|
|
|
2025-02-17 22:11:40 +03:00
|
|
|
"github.com/imgproxy/imgproxy/v3/ierrors"
|
|
|
|
)
|
|
|
|
|
2025-02-18 17:35:13 +03:00
|
|
|
type (
|
|
|
|
VipsError string
|
|
|
|
ColorError string
|
|
|
|
)
|
2025-02-17 22:11:40 +03:00
|
|
|
|
|
|
|
func newVipsError(msg string) error {
|
2025-02-18 17:35:13 +03:00
|
|
|
return ierrors.Wrap(VipsError(msg), 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func newVipsErrorf(format string, args ...interface{}) error {
|
|
|
|
return ierrors.Wrap(VipsError(fmt.Sprintf(format, args...)), 1)
|
2025-02-17 22:11:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e VipsError) Error() string { return string(e) }
|
2025-02-18 17:35:13 +03:00
|
|
|
|
|
|
|
func newColorError(format string, args ...interface{}) error {
|
|
|
|
return ierrors.Wrap(
|
|
|
|
ColorError(fmt.Sprintf(format, args...)),
|
|
|
|
1,
|
|
|
|
ierrors.WithShouldReport(false),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ColorError) Error() string { return string(e) }
|