Skip to content

Commit

Permalink
fix(api): do not raise error 500 on getProjectsHandler from a provider (
Browse files Browse the repository at this point in the history
#3395)

closes #3379
  • Loading branch information
fsamin authored and yesnault committed Oct 3, 2018
1 parent 02236e1 commit 947b73b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions engine/api/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"context"
"database/sql"
"net/http"
"regexp"
"strings"
Expand Down Expand Up @@ -40,6 +41,9 @@ func (api *API) getProjectsHandler() service.Handler {
//Load the specific user
u, err = user.LoadUserWithoutAuth(api.mustDB(), requestedUserName)
if err != nil {
if err == sql.ErrNoRows {
return sdk.ErrUserNotFound
}
return sdk.WrapError(err, "getProjectsHandler> unable to load user '%s'", requestedUserName)
}
if err := loadUserPermissions(api.mustDB(), api.Cache, u); err != nil {
Expand Down

0 comments on commit 947b73b

Please sign in to comment.