Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2689

Misleading error message says function doesn't return required type

    XMLWordPrintable

    Details

    • Steps to reproduce:
      Acceptance/unit test attached

      Description

      If a promise is written with unless => fileexists("$(nosuchvariable)"), the resulting error message falsely reports what the problem is:

         error: ./test.cf:0:0: In attribute 'unless', Function does not return the required type. Given attribute value 'fileexists("$(this.promiser)")'
      

      I first noticed this using unless => fileexists("$(this.promiser)") in a files promise with copy_from, and thought the bug was that this.promiser wasn't working, but I see from the documentation that the "this" variable is documented to be quirky, so fine.

      However, the error message here is misleading. It should say there is an unresolved variable, not imply the function is returning the wrong type.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olehermanse Ole Herman Schumacher Elgesem
                Reporter:
                mweilgart Mike Weilgart
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support

                    Summary Panel