mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
fix 前端报错的问题
This commit is contained in:
@@ -34,7 +34,7 @@ spider:
|
||||
task:
|
||||
workers: 4
|
||||
other:
|
||||
tmppath: "/tmp"
|
||||
tmppath: "./tmp"
|
||||
version: 0.4.3
|
||||
setting:
|
||||
allowRegister: "N"
|
||||
|
||||
@@ -259,6 +259,7 @@ func GetDepJson(c *gin.Context) {
|
||||
_dep, err := services.FetchPythonDepInfo(depName)
|
||||
if err != nil {
|
||||
HandleError(http.StatusInternalServerError, c, err)
|
||||
return
|
||||
}
|
||||
dep = _dep
|
||||
} else {
|
||||
|
||||
@@ -251,6 +251,9 @@ func FetchPythonDepInfo(depName string) (entity.Dependency, error) {
|
||||
return entity.Dependency{}, err
|
||||
}
|
||||
var data PythonDepJsonData
|
||||
if res.Response().StatusCode == 404 {
|
||||
return entity.Dependency{}, errors.New("get depName from [https://pypi.org] error: 404")
|
||||
}
|
||||
if err := res.ToJSON(&data); err != nil {
|
||||
log.Errorf(err.Error())
|
||||
debug.PrintStack()
|
||||
|
||||
Reference in New Issue
Block a user