From e39f70d6cc614a175ec558ff66e1e67f1e60d0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seif=20Lotfy=20=D8=B3=D9=8A=D9=81=20=D9=84=D8=B7=D9=81?= =?UTF-8?q?=D9=8A?= Date: Tue, 28 Feb 2017 19:14:51 -0600 Subject: [PATCH] Return 500 if trying to run path with non-existing image (#546) * Return 500 if trying to run path with non-existing image Fixes: #540 * Add failed task run to logs --- api/server/runner.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/server/runner.go b/api/server/runner.go index 6b800632d..7f0b68c36 100644 --- a/api/server/runner.go +++ b/api/server/runner.go @@ -225,6 +225,13 @@ func (s *Server) serve(ctx context.Context, c *gin.Context, appName string, foun default: result, err := runner.RunTask(s.tasks, ctx, cfg) if err != nil { + c.JSON(http.StatusInternalServerError, runnerResponse{ + RequestID: cfg.ID, + Error: &models.ErrorBody{ + Message: err.Error(), + }, + }) + log.WithError(err).Error("Failed to run task") break } for k, v := range found.Headers {