Simplify workflow.hasError logic

Simplify workflow.hasError logic