mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-25 20:25:01 +00:00
feat(ui): add error page to display errors
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
0d590a4044
commit
67244b7de1
3 changed files with 68 additions and 1 deletions
|
@ -131,7 +131,17 @@ func RegisterUIRoutes(app *fiber.App,
|
|||
page := c.Query("page")
|
||||
items := c.Query("items")
|
||||
|
||||
models, _ := gallery.AvailableGalleryModels(appConfig.Galleries, appConfig.ModelPath)
|
||||
models, err := gallery.AvailableGalleryModels(appConfig.Galleries, appConfig.ModelPath)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("could not list models from galleries")
|
||||
return c.Status(fiber.StatusInternalServerError).Render("views/error", fiber.Map{
|
||||
"Title": "LocalAI - Models",
|
||||
"BaseURL": utils.BaseURL(c),
|
||||
"Version": internal.PrintableVersion(),
|
||||
"ErrorCode": "500",
|
||||
"ErrorMessage": err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
// Get all available tags
|
||||
allTags := map[string]struct{}{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue