mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
No nil errors on error
This commit is contained in:
@@ -70,7 +70,7 @@ func (s *Server) ensureApp(ctx context.Context, c *gin.Context, wroute models.Ro
|
|||||||
// Create a new application
|
// Create a new application
|
||||||
newapp := &models.App{Name: wroute.Route.AppName}
|
newapp := &models.App{Name: wroute.Route.AppName}
|
||||||
if err = newapp.Validate(); err != nil {
|
if err = newapp.Validate(); err != nil {
|
||||||
return nil, err
|
return err, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.FireBeforeAppCreate(ctx, newapp)
|
err = s.FireBeforeAppCreate(ctx, newapp)
|
||||||
@@ -111,7 +111,7 @@ func (s *Server) bindAndValidate(ctx context.Context, c *gin.Context, method str
|
|||||||
p := path.Clean(c.MustGet(api.Path).(string))
|
p := path.Clean(c.MustGet(api.Path).(string))
|
||||||
|
|
||||||
if wroute.Route.Path != "" && wroute.Route.Path != p {
|
if wroute.Route.Path != "" && wroute.Route.Path != p {
|
||||||
return nil, models.ErrRoutesPathImmutable
|
return models.ErrRoutesPathImmutable, models.ErrRoutesPathImmutable
|
||||||
}
|
}
|
||||||
wroute.Route.Path = p
|
wroute.Route.Path = p
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user