|
@@ -148,13 +148,17 @@ func ExploreData(c *context.Context) {
|
|
|
res := libgin.SearchResults{}
|
|
|
if keywords == "" {
|
|
|
// no keywords submitted: don't search
|
|
|
+ log.Trace("Loading empty data search page")
|
|
|
c.Data["Blobs"] = res.Blobs
|
|
|
c.HTML(200, EXPLORE_DATA)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ log.Trace("Searching data/blobs")
|
|
|
data, err := search(c, keywords, sType)
|
|
|
if err != nil {
|
|
|
// c.Handle(http.StatusInternalServerError, "Could not query", err)
|
|
|
+ log.Error(2, "Query returned error: %v", err)
|
|
|
c.Data["Blobs"] = res.Blobs
|
|
|
c.HTML(200, EXPLORE_DATA)
|
|
|
return
|
|
@@ -163,6 +167,7 @@ func ExploreData(c *context.Context) {
|
|
|
err = json.Unmarshal(data, &res)
|
|
|
if err != nil {
|
|
|
// c.Handle(http.StatusInternalServerError, "Could not display result", err)
|
|
|
+ log.Error(2, "Failed to unmarshal response: %v", err)
|
|
|
c.Data["Blobs"] = res.Blobs
|
|
|
c.HTML(200, EXPLORE_DATA)
|
|
|
return
|
|
@@ -187,17 +192,20 @@ func ExploreCommits(c *context.Context) {
|
|
|
|
|
|
res := libgin.SearchResults{}
|
|
|
if keywords == "" {
|
|
|
+ log.Trace("Loading empty commit search page")
|
|
|
// no keywords submitted: don't search
|
|
|
c.Data["Commits"] = res.Commits
|
|
|
c.HTML(200, EXPLORE_COMMITS)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ log.Trace("Searching commits")
|
|
|
data, err := search(c, keywords, sType)
|
|
|
|
|
|
if err != nil {
|
|
|
// c.Handle(http.StatusInternalServerError, "Could not query", err)
|
|
|
// return
|
|
|
+ log.Error(2, "Query returned error: %v", err)
|
|
|
c.Data["Commits"] = res.Commits
|
|
|
c.HTML(200, EXPLORE_COMMITS)
|
|
|
}
|
|
@@ -205,6 +213,7 @@ func ExploreCommits(c *context.Context) {
|
|
|
err = json.Unmarshal(data, &res)
|
|
|
if err != nil {
|
|
|
// c.Handle(http.StatusInternalServerError, "Could not display result", err)
|
|
|
+ log.Error(2, "Failed to unmarshal response: %v", err)
|
|
|
c.Data["Commits"] = res.Commits
|
|
|
c.HTML(200, EXPLORE_COMMITS)
|
|
|
return
|