Closed kasongoyo closed 7 years ago
My expectation would be that you would not see the "info" and "error" properties on the Error itself when you use console.log
, but that you can get them with the VError.cause(error)
and VError.info(error)
functions.
@davepacheco Thanks for your promptness well your guess is correct and I have succeeded. I've also discovered the existence of jse_info
property in VError
instance.
I'm glad that worked.
The jse_info property is private and may change or disappear in future versions (even micro or minor versions).
May be I am missing something about this library well I have created an instance of WError in my mongoose schema and I propagate that error to other places that use the schema then to my surprise I can't find the properties like info and cause I previously set when an error occured and instead I get normal nodejs error properties(stack and message). Where do I go wrong? I thought ths library could help to wrap my errors so that I can add custom properties etc and use it anywhere in my application.
My mongoose schema plugin;
My test case that utilize error;