[add] better search error handling

This commit is contained in:
2023-10-26 06:20:56 -04:00
parent 37b6ac10ac
commit b9b9ad2098
2 changed files with 76 additions and 30 deletions

View File

@@ -209,7 +209,12 @@ func (api *API) createAppResourcesRoute(routeName string, args ...map[string]any
}
// Search
searchResults := search.SearchBook(*sParams.Query, bType)
searchResults, err := search.SearchBook(*sParams.Query, bType)
if err != nil {
errorPage(c, http.StatusInternalServerError, fmt.Sprintf("Search Error: %v", err))
return
}
templateVars["Data"] = searchResults
templateVars["BookType"] = *sParams.BookType
}