Skip to content

Improve error message when the YAML config file is empty #728

Open
@adityasharad

Description

@adityasharad

Using the Runner with --config-file <path to an empty file> leads to the following error. Looking at the code I expect the same applies to the Action.
This is admittedly an unusual case, but it has appeared in at least one support request, so we should provide a more helpful warning and carry on, rather than crashing.

TypeError: Cannot use 'in' operator to search for 'name' in undefined
    at loadConfig (/snapshot/dist/codeql-runner.js)
    at Object.initConfig (/snapshot/dist/codeql-runner.js)
    at Object.initConfig (/snapshot/dist/codeql-runner.js)
    at Command.<anonymous> (/snapshot/dist/codeql-runner.js)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions