Skip to content

Improve error message on missing = in config #4373

@bentsherman

Description

@bentsherman

Spun off from #4372. Consider the following configuration:

process {
  cpus = 2
  memory 4.GB // incorrect
}

Omitting the = in a config setting should lead to a syntax error, but instead it is interpreted as a command expression and usually leads to a non-sensical error:

ERROR ~ Unknown method invocation `memory` on _parse_closure5 type -- Did you mean?
  memoize

 -- Check '.nextflow.log' file for details

Instead it should be reported as a syntax error. This error happens often because of the different syntax for process config options and process directives.

The error is thrown from here:

MetaMethod mm = mc.getMetaMethod(name, args)
if (mm) {
result = mm.invoke(delegate, args)
} else {
throw new MissingMethodException(name, getClass(), args)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions