diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-01-06 09:09:00 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-01-06 09:17:20 -0400 |
commit | bca7dbeebc6205aa36d480d9dd9db9c645c7b353 (patch) | |
tree | 8bd58f9125076df4d8d81aab68e581f64b54f939 | |
parent | 95d6d14500c36e96836f0b74a845e31c04dec62c (diff) |
yaml: don't display internal property in FieldValueError
-rw-r--r-- | src/data/yaml.js | 9 |
1 files changed, 3 insertions, 6 deletions
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}); } } |