🐛 Fixed NotFound error for entry in multilingual mode

This commit is contained in:
Maxim Lebedev 2024-02-14 13:47:27 +06:00
parent b623527ff5
commit 40c3565173
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 5 additions and 3 deletions

View File

@ -190,11 +190,13 @@ func NewApp(logger *log.Logger, config *domain.Config) (*App, error) {
// code in subdir.
e, err := entrier.Do(r.Context(), lang, tail)
if err != nil {
if !errors.Is(err, entry.ErrNotExist) {
if errors.Is(err, entry.ErrNotExist) {
http.NotFound(w, r)
} else {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
return
}
// NOTE(toby3d): wrap founded entry into theme template and