mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fix datastore error for inexistent app (#493)
* fix datastore error inexistent app * fix get route error handling * fix API errors handling and tests
This commit is contained in:
committed by
Travis Reeder
parent
5a91710dbf
commit
a80fe9c897
@@ -37,13 +37,8 @@ func (s *Server) handleAppDelete(c *gin.Context) {
|
||||
}
|
||||
|
||||
err = s.Datastore.RemoveApp(ctx, app.Name)
|
||||
if err == models.ErrAppsNotFound {
|
||||
log.WithError(err).Debug(models.ErrAppsRemoving)
|
||||
c.JSON(http.StatusNotFound, simpleError(err))
|
||||
return
|
||||
} else if err != nil {
|
||||
log.WithError(err).Error(models.ErrAppsRemoving)
|
||||
c.JSON(http.StatusInternalServerError, simpleError(ErrInternalServerError))
|
||||
if err != nil {
|
||||
handleErrorResponse(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user