From bca7dbeebc6205aa36d480d9dd9db9c645c7b353 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 6 Jan 2024 09:09:00 -0400 Subject: yaml: don't display internal property in FieldValueError --- src/data/yaml.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/data/yaml.js b/src/data/yaml.js index 1fd37b2f..caf414e5 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -262,7 +262,7 @@ function makeProcessDocument( thing[property] = value; } catch (caughtError) { skippedFields.add(field); - fieldValueErrors.push(new FieldValueError(field, property, value, caughtError)); + fieldValueErrors.push(new FieldValueError(field, value, caughtError)); } } @@ -346,18 +346,15 @@ export class FieldValueAggregateError extends AggregateError { } export class FieldValueError extends Error { - constructor(field, property, value, cause) { + constructor(field, value, cause) { const fieldText = colors.green(`"${field}"`); - const propertyText = - colors.green(property); - const valueText = inspect(value, {maxStringLength: 40}); super( - `Failed to set ${fieldText} field (${propertyText}) to ${valueText}`, + `Failed to set ${fieldText} field to ${valueText}`, {cause}); } } -- cgit 1.3.0-6-gf8a5