This makes error handling more liberal, supporting errors from posthtml-expressions that aren't instances of Error, see posthtml/posthtml-expressions#89. Also, now error stack is displayed, which is very useful for plugins like gulp-posthtml.
```
Message:
Cannot read property 'bar' of undefined
Details:
domainEmitter: [object Object]
domainThrown: false
Stack:
evalmachine.:1
foo.bar
^
TypeError: Cannot read property 'bar' of undefined
at evalmachine.:1:5
at Script.runInContext (vm.js:141:18)
at Object.runInContext (vm.js:279:6)
at placeholders (/Users/silvenon/Code/repro/node_modules/posthtml-expressions/lib/placeholders.js:57:20)
at /Users/silvenon/Code/repro/node_modules/posthtml-expressions/lib/index.js:182:14
at Array.reduce ()
at walk (/Users/silvenon/Code/repro/node_modules/posthtml-expressions/lib/index.js:169:27)
at /Users/silvenon/Code/repro/node_modules/posthtml-expressions/lib/index.js:206:22
at Array.reduce ()
at walk (/Users/silvenon/Code/repro/node_modules/posthtml-expressions/lib/index.js:169:27)
```
I tried adding a test, but there is some weird race condition going on when running that test with sugarml tests, and I wasn't able to figure out what was going on there.
Commit Message Summary (CHANGELOG)
Improve emitting errors and show stack
- now errors from posthtml-expressions are properly displayed
Coverage remained the same at 87.097% when pulling 253a944bcaffb68c6b86afa2b326f0c5ab54aad5 on silvenon:improve-error-handling into 79483f47d63e8c8f4003dc419fb9f662c52f0a19 on posthtml:master.
Notable Changes
This makes error handling more liberal, supporting errors from posthtml-expressions that aren't instances of
Error
, see posthtml/posthtml-expressions#89. Also, now error stack is displayed, which is very useful for plugins like gulp-posthtml.Without stack:
With stack:
I tried adding a test, but there is some weird race condition going on when running that test with sugarml tests, and I wasn't able to figure out what was going on there.
Commit Message Summary (CHANGELOG)
Type
SemVer
Issues
Checklist