feat: add error handling
This commit is contained in:
parent
cc19a48c9e
commit
b3e1b4f212
@ -3,7 +3,6 @@ package route
|
||||
import (
|
||||
"leech/config"
|
||||
"leech/html"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
@ -42,7 +41,7 @@ func HandleList(c *fiber.Ctx) error {
|
||||
completePath := path.Join(pathSlice...)
|
||||
files, err := os.ReadDir(completePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
|
||||
}
|
||||
entries := []html.Entry{}
|
||||
for _, f := range files {
|
||||
|
Loading…
Reference in New Issue
Block a user