Proper logging

This commit is contained in:
Ben Sarmiento
2023-10-20 01:38:05 +02:00
parent 1117e777ff
commit 464f522fea
5 changed files with 46 additions and 7 deletions

View File

@@ -82,7 +82,7 @@ func Setup(app *aero.Application, c config.ConfigInterface, t *torrent.TorrentMa
filenameV2, linkFragment := davextra.ExtractLinkFragment(filename)
link := getLink(torrents, filenameV2, linkFragment)
if link == "" {
log.Println("Link not found")
log.Println("Link not found", filename)
return ctx.Error(http.StatusNotFound, "Cannot find file")
}
@@ -94,7 +94,7 @@ func Setup(app *aero.Application, c config.ConfigInterface, t *torrent.TorrentMa
// TODO: Readd the file
// when unrestricting fails, it means the file is not available anymore
// if it's the only file, tough luck
log.Println("Cannot unrestrict link")
log.Println("Cannot unrestrict link", link, filenameV2)
return ctx.Error(http.StatusNotFound, "Cannot find file")
}
if resp.Filename != filenameV2 {