Small fixes

This commit is contained in:
Denis Arh
2021-03-12 13:12:07 +01:00
parent 8335b69197
commit 800b246926
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -485,12 +485,12 @@ func (svc *trigger) registerTriggers(wf *types.Workflow, runAs auth.Identifiable
if g == nil {
handlerFn = func(_ context.Context, ev eventbus.Event) error {
return errors.Internal(
"trigger %s on %s failed due to invalid workflow %d: %w",
"trigger %s on %s failed due to invalid workflow %d: %s",
ev.EventType(),
ev.ResourceType(),
wf.ID,
wf.Issues,
)
).Wrap(wf.Issues)
}
} else {
handlerFn = makeWorkflowHandler(svc.session, t, wf, g, runAs)
+3 -2
View File
@@ -511,12 +511,13 @@ func verifyStep(s *types.WorkflowStep, in, out types.WorkflowPathSet) types.Work
return nil
}
requiredArg = func(argName string, typ expr.Type) func() error {
return func() error {
if msgArg := types.ExprSet(s.Arguments).GetByTarget(argName); msgArg == nil {
return errors.Internal("%s step expects to have '%s' argument", argName)
return errors.Internal("%s step expects to have '%s' argument", s.Kind, argName)
} else if msgArg.Type != typ.Type() {
return errors.Internal("%s argument on error step must be string, got type '%s'", argName, msgArg.Type)
return errors.Internal("%s argument on %s step must be %s, got type '%s'", argName, s.Kind, typ.Type(), msgArg.Type)
}
return nil