Better error message for wrong configured metrics https://github.com/sitespeedio/sitespeed.io/issues/3256
This commit is contained in:
parent
0fc532664d
commit
f972877174
|
|
@ -41,6 +41,11 @@ module.exports = {
|
|||
for (let metricType of Object.keys(budgetForThisURL)) {
|
||||
for (let metric of Object.keys(budgetForThisURL[metricType])) {
|
||||
if (friendlyNames[tool][metricType]) {
|
||||
if (!friendlyNames[tool][metricType][metric]) {
|
||||
log.error(
|
||||
`It seems like you configure a metric ${metric} that we do not have a friendly name. Please check the docs if it is right.`
|
||||
);
|
||||
}
|
||||
const fullPath = friendlyNames[tool][metricType][metric].path;
|
||||
let value = get(message.data, fullPath);
|
||||
if (value && message.type === 'lighthouse.pageSummary') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue