lighthouse: runTimeError exists when there are NO_ERRORs
Ran into this working on a web server that returns LH results. It’s unexpected that runTimeErrors
exists in the LHR if there were no errors! It also requires users to check for a “NO_ERROR” string code which overcomplicates matters.
if (lhr.runtimeError && lhr.runtimeError.code !== 'NO_ERROR') {
throw new Error(`${lhr.runtimeError.code} ${lhr.runtimeError.message}`);
}

Environment Information
- Affected Channels: all
- Lighthouse version: 3.2.1
- Node.js version: 10+
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (12 by maintainers)
I’m not really satisfied with the node outcome right now. Eliminating the
"runtimeError": {"code": "NO_ERROR"}
was the original point of the issue I believe, so seeing that through in all environments seems reasonable.I think I still stand by my opinions/suggestions in https://github.com/GoogleChrome/lighthouse/issues/6336#issuecomment-443876702, so good to see a few months hasn’t changed me too much 😃
So @patrickhulce response made me look more into the LR errors, and I finally found the root cause (#6739)! So I am going to table more advanced error handling (#6671) for later. But I definitely think that PSI error handling needs to be re-evaluated next, but I’m going to leave LH CLI, node and others for later.