improve error logging
1 file changed, 2 insertions(+), 3 deletions(-)
changed files
M routes/handler.go → routes/handler.go
@@ -21,6 +21,7 @@ var ( ErrMethodNotAllowed = fmt.Errorf("that's not possible") ErrNotFound = fmt.Errorf("nothing like that here") + ErrRepoDenied = fmt.Errorf("nothing like that here") ) func Handlers(c *config.Config, staticFiles fs.FS) *atreugo.Atreugo {@@ -122,9 +123,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - log.Printf("access not allowed: %s", repoName) - - return ErrNotFound + return fmt.Errorf("repo %s: %w", repoName, ErrRepoDenied) } rc.SetUserValue("repoName", repoName)