mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 20:22:31 +02:00
Better imgproxyError handling
This commit is contained in:
@@ -55,6 +55,13 @@ func newUnexpectedError(msg string, skip int) *imgproxyError {
|
||||
}
|
||||
}
|
||||
|
||||
func wrapError(err error, skip int) *imgproxyError {
|
||||
if ierr, ok := err.(*imgproxyError); ok {
|
||||
return ierr
|
||||
}
|
||||
return newUnexpectedError(err.Error(), skip+1)
|
||||
}
|
||||
|
||||
func callers(skip int) []uintptr {
|
||||
stack := make([]uintptr, 10)
|
||||
n := runtime.Callers(skip, stack)
|
||||
|
Reference in New Issue
Block a user