clarify
clarify copied to clipboard
Option to indicate that a frame was removed
Sometimes internals calls (e.g. for require) will involve about 8 calls in a row. It would be good to indicate that these calls have been filtered (allowing a custom message - i would prefer to tell the user what is removed stack trace calls...silent errors can be deadly).
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at join (path.js:1211:7)
at LinkedPackage._callee4$ (/Users/Vaughan/dev-live/shipmate/src/plugins/linked-modules/index.js:99:36)
at LinkedPackage.getNpmLinkedVersion (/Users/Vaughan/dev-live/shipmate/src/plugins/linked-modules/index.js:100:25)
at VersionChecker._callee8$ (/Users/Vaughan/dev-live/shipmate/src/plugins/linked-modules/index.js:155:33)
---------------------------------------------
at Object.<anonymous> (/Users/Vaughan/dev-live/shipmate/src/index.js:13:9)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/Vaughan/dev-live/shipmate/src/cli/publish.js:1:1)
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at join (path.js:1211:7)
at LinkedPackage._callee4$ (/Users/Vaughan/dev-live/shipmate/src/plugins/linked-modules/index.js:99:36)
at LinkedPackage.getNpmLinkedVersion (/Users/Vaughan/dev-live/shipmate/src/plugins/linked-modules/index.js:100:25)
at VersionChecker._callee8$ (/Users/Vaughan/dev-live/shipmate/src/plugins/linked-modules/index.js:155:33)
---------------------------------------------
[removed by clarify]
at Object.<anonymous> (/Users/Vaughan/dev-live/shipmate/src/cli/publish.js:1:1)
silent errors can be deadly
sure, but clarify shouldn't make them silent. It just shortens them.
It would be good to indicate that these calls have been filtered
How should this be integrated into the v8 CallSite API?
How should this be integrated into the v8 CallSite API?
The longjohn module does it when showing stack traces across nextTick by creating a dummy CallSite object and setting its getFileName() property to a divider.
I believe the source-map-support module does similar.
The longjohn module does it when showing stack traces across nextTick by creating a dummy CallSite object and setting its getFileName() property to a divider.
That is just a part of the hack. The reason why it works is because it implements its own stack trace formatter that checks for getFileName(). https://github.com/mattinsler/longjohn/blob/master/lib/longjohn.coffee#L44
I'm not saying it is impossible, but it will be very hard to ensure compatibility. At some point stack-chain will mature enough to support this, but that is a long way ahead.
Ah this explains why longjohn was crashing when I tried to implement it.
So what would be best is if we made longjohn compatible with the stack-chain formatter.
So what would be best is if we made longjohn compatible with the stack-chain formatter.
That would be lovely :) But fortunately my policy with my stack trace lineup (stack-chain, async-hook, trace, clarify) is that there don't exists an hypothetical scenario where it breaks, this is why it works with longjohn in first place. I have my own long-stack-trace implementation that I could just support.
The long term solution is to investigate the cause and appropriate action to https://github.com/AndreasMadsen/stack-chain/issues/7
If you prefer a quick solution I think you should write your own clarify module.