diff --git a/errors/errors.go b/errors/errors.go index 678c54b9e219cd031dfb42d2b5ca692ff0bb82e8..44dbf8f60f6fdae1aa8fcdb62c41b50a7a2a478e 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -101,6 +101,11 @@ func HTTPCodeOnly(code int) error { } func HTTPWithError(code int, err error) error { + // This check is here just as a failsafe, if err is nil then just return nil because there's nothing that happened. + if err == nil { + return nil + } + wrappedErr := &CustomError{ code: code, message: err.Error(),