return error with condition or match