Simplify workflow.hasError logic