File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
lighthouse-core/aggregator Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -77,20 +77,26 @@ class Aggregate {
7777 typeof expected . rawValue === 'undefined' ||
7878 typeof expected . weight === 'undefined' ) {
7979 const msg =
80- `Config for ${ name } is undefined or does not contain rawValue and weight properties` ;
80+ `aggregations: ${ name } criteria does not contain expected rawValue or weight properties` ;
8181 throw new Error ( msg ) ;
8282 }
8383
8484 if ( typeof result === 'undefined' ||
8585 typeof result . score === 'undefined' ) {
86- const msg =
87- `Audit result for ${ name } is undefined or does not contain score property` ;
86+ let msg =
87+ `${ name } audit result is undefined or does not contain score property` ;
88+ if ( result && result . debugString ) {
89+ msg += ': ' + result . debugString ;
90+ }
8891 throw new Error ( msg ) ;
8992 }
9093
9194 if ( typeof result . score !== typeof expected . rawValue ) {
92- const msg =
95+ let msg =
9396 `Expected rawValue of type ${ typeof expected . rawValue } , got ${ typeof result . rawValue } ` ;
97+ if ( result . debugString ) {
98+ msg += ': ' + result . debugString ;
99+ }
94100 throw new Error ( msg ) ;
95101 }
96102
You can’t perform that action at this time.
0 commit comments