I see that according to MDN - Error documentation, the Error object might have different behavior across different browsers.
I'd like to check what is your opinion regarding adding properties on the default Error object.
In my specific code, I'd like to tag an Error object with my own tag name for further use, which means -> adding a property to the object as follows:
const error = new Error('some message')
if(someConditionExist()){
error.__myTag = 'tag1';
}
else {
error.__myTag = 'tag2';
}
//then throwing the error and catch it elsewhere...
I haven't seen any guidelines what are the implications (if any...) of such thing.
Is any of you have any concerns? Have you encountered any issues across different browsers?