diff --git a/api/server/runner.go b/api/server/runner.go index b14816d86..3295ea0d3 100644 --- a/api/server/runner.go +++ b/api/server/runner.go @@ -103,12 +103,6 @@ func handleRunner(c *gin.Context) { return } - if routes == nil || len(routes) == 0 { - log.WithError(err).Error(models.ErrRunnerRouteNotFound) - c.JSON(http.StatusNotFound, simpleError(models.ErrRunnerRouteNotFound)) - return - } - log.WithField("routes", routes).Debug("Got routes from datastore") for _, el := range routes { if params, match := matchRoute(el.Path, route); match { @@ -172,6 +166,8 @@ func handleRunner(c *gin.Context) { } } + log.WithError(err).Error(models.ErrRunnerRouteNotFound) + c.JSON(http.StatusNotFound, simpleError(models.ErrRunnerRouteNotFound)) } var fakeHandler = func(http.ResponseWriter, *http.Request, Params) {}