Expose option to override properties included on Plugin Error, copy all properties from original error by default #53
Conversation
I would think this should require a minor revision bump. |
opt.properties = []; | ||
} | ||
|
||
opt.properties = _.uniq(defaultProperties.concat(opt.properties)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're using lodash for only one function, use the split out version. the module for this would be lodash.uniq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just https://github.com/sindresorhus/array-uniq which is completely self-contained.
What's the verdict on this? |
needs a rebase for merge |
…ll properties from original error by default
Rebased! |
My only complaint is the "properties" field name - I think we need something a little more descriptive. What does "properties" mean if I do |
How does |
Expose option to override properties included on Plugin Error, copy all properties from original error by default
I'll take another PR documenting these changes before I publish |
Currently when you create a PluginError with an existing error the properties of the original error are lost unless they are included on an internal list of white listed properties. I propose two enhancements: