mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-26 12:18:33 -05:00
fix: better error string for CEL (#890)
This commit is contained in:
+7
-1
@@ -111,5 +111,11 @@ func (p *CELParser) ParseAndEvalWorkflowString(workflowExp string, in WorkflowSt
|
||||
return "", err
|
||||
}
|
||||
|
||||
return out.Value().(string), nil
|
||||
// Switch on the type of the output.
|
||||
switch out.Type() {
|
||||
case types.StringType:
|
||||
return out.Value().(string), nil
|
||||
default:
|
||||
return "", fmt.Errorf("output must evaluate to a string: got %s", out.Type().TypeName())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user