Predefine static errors

This commit is contained in:
DarthSim
2018-10-06 02:29:55 +06:00
parent 85d2738a72
commit 776f57d003
6 changed files with 29 additions and 18 deletions

View File

@@ -26,11 +26,6 @@ func newUnexpectedError(err error, skip int) imgproxyError {
return imgproxyError{500, msg, "Internal error"}
}
var (
invalidSecretErr = newError(403, "Invalid secret", "Forbidden")
invalidMethodErr = newError(422, "Invalid request method", "Method doesn't allowed")
)
func stacktrace(skip int) string {
callers := make([]uintptr, 10)
n := runtime.Callers(skip+1, callers)