More readable error message for invalid queries block and invalid query-filters block by aeisenberg · Pull Request #1208 · github/codeql-action (original) (raw)

added 2 commits

August 15, 2022 07:56

@aeisenberg

When someone creates an invalid queries entry in the codeql config file, like this:

queries:
  - foo.ql

THe error message is confusing, looking like this:

  Error: Cannot use 'in' operator to search for 'uses' in ql/ql/src
  TypeError: Cannot use 'in' operator to search for 'uses' in ql/ql/src
      at loadConfig (/home/runner/work/_actions/github/codeql-action/71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca/lib/config-utils.js:577:41)

With this change, the error message is more comprehensible:

queries must be an array, with each entry having a 'uses' property

@aeisenberg

Handle other cases where the config is invalid.

@aeisenberg

@aeisenberg

henrymercer

@aeisenberg @henrymercer

Co-authored-by: Henry Mercer henrymercer@github.com

@aeisenberg aeisenberg deleted the aeisenberg/better-error-message branch

August 23, 2022 18:29

@aeisenberg aeisenberg changed the titleMore readable error message for invalid queries block and invalid query-filters blocl More readable error message for invalid queries block and invalid query-filters block

Aug 26, 2022

This was referenced

Dec 1, 2023

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})