From d177c8fc71bc161e56ba7422307e4a76d26a904f Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Fri, 3 Jul 2020 09:49:10 +0200 Subject: [PATCH] feat(api): improve error msg on workflow import (#5288) --- engine/api/workflow/dao.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/api/workflow/dao.go b/engine/api/workflow/dao.go index 1b145612a2..93842b7ab8 100644 --- a/engine/api/workflow/dao.go +++ b/engine/api/workflow/dao.go @@ -842,7 +842,7 @@ func checkHooks(db gorp.SqlExecutor, w *sdk.Workflow, n *sdk.Node) error { h.HookModelID = hm.ID } if h.HookModelName == sdk.RepositoryWebHookModelName && (n.Context == nil || n.Context.ApplicationID == 0) { - return sdk.WrapError(sdk.ErrNotFound, "unable to find application for the repository web hook: %d: %s/%s", w.ID, w.Name, n.Name) + return sdk.NewErrorFrom(sdk.ErrWrongRequest, "unable to find application for the repository webhook: %s/%s", w.Name, n.Name) } // Add missing default value for hook