Skip to content

Commit

Permalink
fix #120
Browse files Browse the repository at this point in the history
  • Loading branch information
mraron committed Sep 2, 2024
1 parent 75660a5 commit 89083f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/web/handlers/user/profile/middleware.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package profile

import (
"github.com/mraron/njudge/internal/web/templates"
"errors"
"net/http"
"net/url"

"github.com/mraron/njudge/internal/web/templates"

"github.com/labstack/echo/v4"
"github.com/mraron/njudge/internal/njudge"
)
Expand All @@ -27,6 +29,9 @@ func SetProfileMiddleware(u njudge.Users) echo.MiddlewareFunc {

user, err := u.GetByName(c.Request().Context(), name)
if err != nil {
if errors.Is(err,njudge.ErrorUserNotFound) {
return echo.NewHTTPError(http.StatusNotFound, err.Error() )
}
return err
}

Expand Down

0 comments on commit 89083f2

Please sign in to comment.