return an error if notEmpty: true and bracket is empty