Refactor package (routes and error handling, npm peer dependency) (#33111)
This commit is contained in:
parent
ef736b7e27
commit
80e4f4c4eb
28 changed files with 153 additions and 244 deletions
|
@ -5,6 +5,7 @@ package pypi
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"regexp"
|
||||
|
@ -94,7 +95,7 @@ func DownloadPackageFile(ctx *context.Context) {
|
|||
},
|
||||
)
|
||||
if err != nil {
|
||||
if err == packages_model.ErrPackageNotExist || err == packages_model.ErrPackageFileNotExist {
|
||||
if errors.Is(err, packages_model.ErrPackageNotExist) || errors.Is(err, packages_model.ErrPackageFileNotExist) {
|
||||
apiError(ctx, http.StatusNotFound, err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue