Novaleaf / xlib

Your isomorphic toolbox
MIT License
20 stars 1 forks source link

usability: if new Exception message already contains innerError message, don't append it again #8

Closed jasonswearingen closed 5 years ago

jasonswearingen commented 5 years ago

expected usage of innerError is:

const oldErr;
const err = new xlib.diagnostics.Exception("my msg",{innerError:oldErr});

the above will paste the innerError.message as part of the new err.message.

however, if the user manually pastes in the innerError.message as the following, we should not double-paste it.

const oldErr;
const err = new xlib.diagnostics.Exception("my msg.  innerErr="+oldErr.message,{innerError:oldErr});