cli icon indicating copy to clipboard operation
cli copied to clipboard

Add better error messages

Open BioPhoton opened this issue 1 year ago • 0 comments

What happened?

I used onlyAudits: ['csp-xss'] in the lighthouse config object and run nx code-pushup -- collect i get the following error:

ZodError: [
  {
    "code": "custom",
    "message": "In a category there has to be at least one ref with weight > 0",
    "path": [
      "plugins",
      5,
      "groups",
      0,
      "refs"
    ]
  }
]
Screenshot 2024-08-03 at 15 27 40

What would you expect to happen?

It should show more information of where the error was caused.

Examples File error:

  • Error: Failed parsing core config. Path: code-pushup.config.ts.

Examples Parsing error:

  • plugins[1].title: Required
  • plugins[1].audits: Array must contain at least 1 element(s)
  • plugins[1].groups[0].title: Required
  • plugins[1].groups[0].refs[0].weight: Required
  • persist.format[0]: Invalid enum value. Expected 'json' | 'md', received 'html'
  • plugins[1].slug: The slug has to follow the pattern [0-9a-z] followed by multiple optional groups of -[0-9a-z].
Screenshot 2024-08-03 at 15 26 31

What steps did you take?

I used onlyAudits: ['csp-xss'] in the lighthouse config object and run nx code-pushup -- collect i get the following error:

Code PushUp package version

No response

What operation system are you on?

Linux

Node version

No response

Relevant log output

No response

Related

https://github.com/causaly/zod-validation-error/issues/357

BioPhoton avatar Jun 12 '24 17:06 BioPhoton