-
-
Notifications
You must be signed in to change notification settings - Fork 23
Feature: Installed node modules / Additional Info #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Conflicts: dist/exceptionless.node.js.map
…ss.JavaScript into feature/additionalInfo
Conflicts: dist/exceptionless.node.js.map
|
||
private getAdditionalData(exception: Error): { [key: string]: any } { | ||
let keys = Object.keys(exception) | ||
.filter(key => this.ignoredProperties.indexOf(key) < 0); |
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.
Might want to check to see if the property is a function here.
Looks great! I just noticed a use case where the extended data item could be added if any extra properties were functions (which would then return an empty object). If you want I can make this change. |
@niemyjski Thanks for your review; just made some enhancements and added more unit tests, that should do the trick. Empty extended data won't be added now. |
1621ee5
to
b633648
Compare
Great job! I was thinking about this more this morning and I think that once we get our changes to parse depth and exclusions be generic.. We could come back to this and use that for parsing additional properties (share more code). |
Feature: Installed node modules / Additional Info
Somehow, I managed to corrupt the other pull request, so here is a new one:
This feature (Issue #6) adds a
NodeModuleCollector.ts
that tries to find all currently loaded npm modules:npm ls --depth=0 --json
to get all installed packages on root level. Those modules are cached, as they won't change during runtime.require.cache
to get all currently cached modules. Those are all JavaScript files that have been required since startup of the application./node_modules/
, which is the module name, and makes them unique.Furthermore, it iterates all exception properties and puts them in the
@ext
data field on the error object, showing them as "Additional Data" in the UI (Issue #8). The following properties are currently ignored: