Created
February 5, 2018 21:33
-
-
Save petebacondarwin/3a980ed8a7b74299ddb7381b74515614 to your computer and use it in GitHub Desktop.
Unhandled Exception Trimming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================== | |
Firefox on Android | |
====================== | |
something terrible has happened. oh no. oh no. | |
AppComponent@app.component.ts:31:29 | |
createClass@core.umd.js:12200:20 | |
createDirectiveInstance@core.umd.j | |
====================== | |
Safari 11 | |
====================== | |
something terrible has happened. oh no. oh no. | |
AppComponent | |
createClass | |
createDirectiveInstance | |
createViewNodes | |
createRootView | |
callWithDebugContext | |
cr | |
====================== | |
Opera 50 | |
====================== | |
something terrible has happened. oh no. oh no. | |
at new AppComponent@app.component.ts:31:29) | |
at createClass@core.umd.js:12200:20) | |
at createDirectiveInst | |
====================== | |
Chrome 64 (desktop + android) | |
====================== | |
something terrible has happened. oh no. oh no. | |
at new AppComponent@app.component.ts:31:29) | |
at createClass@core.umd.js:12200:20) | |
at createDirectiveInst | |
====================== | |
Firefox 58 | |
====================== | |
something terrible has happened. oh no. oh no. | |
AppComponent@app.component.ts:31:29 | |
createClass@core.umd.js:12200:20 | |
createDirectiveInstance@core.umd.j | |
====================== | |
Edge 16 | |
====================== | |
something terrible has happened. oh no. oh no. | |
at AppComponent (eval code:31:21) | |
at createClass (eval code:12200:13) | |
at createDirectiveInstance (eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatError(msg, url, line, col, e) { | |
var stack; | |
msg = msg.replace(/^Error: /, ''); | |
if (e) { | |
stack = e.stack | |
// strip the leading "Error: " from the stack trace | |
.replace(/^Error: /,'') | |
// strip the message from the stack trace, if present | |
.replace(msg + '\n', '') | |
// strip all leading " at " for each frame | |
.replace(/^ +at /gm, '') | |
// replace long urls with just the last segment: `filename:line:column` | |
.replace(/(?: \(|@)http.+\/([^/]+)\)?\n/gm, '@$1\n'); | |
} else { | |
line = line || '?'; | |
col = col || '?'; | |
stack = url + ':' + line + ':' + col; | |
} | |
return (msg + '\n' + stack).substr(0, 150); | |
} | |
console.log('======================\nFirefox on Android\n======================'); | |
console.log(formatError('Error: something terrible has happened. oh no. oh no.', null, null, null, { stack: `AppComponent@https://angular-axqlkx.stackblitz.io/tmp/appfiles/app/app.component.ts:31:29 | |
createClass@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12200:20 | |
createDirectiveInstance@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12049:37 | |
createViewNodes@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13487:53 | |
createRootView@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13377:5 | |
callWithDebugContext@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14778:39 | |
debugCreateRootView@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14079:12 | |
ComponentFactory_.prototype.create@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:10998:37 | |
ComponentFactoryBoundToModule.prototype.create@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:3958:16 | |
ApplicationRef.prototype.bootstrap@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5769:40 | |
PlatformRef.prototype._moduleDoBootstrap/<@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5496:74 | |
PlatformRef.prototype._moduleDoBootstrap@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5496:13 | |
PlatformRef.prototype.bootstrapModuleFactory/</</<@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5417:21 | |
ZoneDelegate.prototype.invoke@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:392:17 | |
forkInnerZoneWithAngularBehavior/zone._inner<.onInvoke@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:4665:24 | |
ZoneDelegate.prototype.invoke@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:391:17 | |
Zone.prototype.run@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:142:24 | |
scheduleResolveOrReject/<@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:873:52 | |
ZoneDelegate.prototype.invokeTask@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:425:17 | |
forkInnerZoneWithAngularBehavior/zone._inner<.onInvokeTask@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:4656:24 | |
ZoneDelegate.prototype.invokeTask@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:424:17 | |
Zone.prototype.runTask@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:192:28 | |
drainMicroTaskQueue@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:602:25 | |
[608]/E/</<@https://c.staticblitz.com/assets/packs/common-7c635cf1d1bf1b16dfee.js:1:35475 | |
[608]/E/<@https://c.staticblitz.com/assets/packs/common-7c635cf1d1bf1b16dfee.js:1:35345 | |
[564]/t.exports/a@https://c.staticblitz.com/assets/packs/common-7c635cf1d1bf1b16dfee.js:1:26331` })); | |
console.log('======================\nSafari 11\n======================'); | |
console.log(formatError('Error: something terrible has happened. oh no. oh no.', null, null, null, { stack: `AppComponent | |
createClass | |
createDirectiveInstance | |
createViewNodes | |
createRootView | |
callWithDebugContext | |
create | |
bootstrap | |
forEach@[native code] | |
_moduleDoBootstrap | |
onInvoke | |
run | |
onInvokeTask | |
runTask | |
drainMicroTaskQueue | |
promiseReactionJob@[native code]` })); | |
console.log('======================\nOpera 50\n======================'); | |
console.log(formatError('Error: something terrible has happened. oh no. oh no.', null, null, null, { stack: `Error: something terrible has happened. oh no. oh no. | |
at new AppComponent (https://angular-axqlkx.stackblitz.io/tmp/appfiles/app/app.component.ts:31:29) | |
at createClass (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12200:20) | |
at createDirectiveInstance (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12049:37) | |
at createViewNodes (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13487:53) | |
at createRootView (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13377:5) | |
at callWithDebugContext (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14778:42) | |
at Object.debugCreateRootView [as createRootView] (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14079:12) | |
at ComponentFactory_.create (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:10998:46) | |
at ComponentFactoryBoundToModule.create (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:3958:29) | |
at ApplicationRef.bootstrap (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5769:57)` })); | |
console.log('======================\nChrome 64 (desktop + android)\n======================'); | |
console.log(formatError('Error: something terrible has happened. oh no. oh no.', null, null, null, { stack: `Error: something terrible has happened. oh no. oh no. | |
at new AppComponent (https://angular-axqlkx.stackblitz.io/tmp/appfiles/app/app.component.ts:31:29) | |
at createClass (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12200:20) | |
at createDirectiveInstance (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12049:37) | |
at createViewNodes (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13487:53) | |
at createRootView (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13377:5) | |
at callWithDebugContext (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14778:42) | |
at Object.debugCreateRootView [as createRootView] (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14079:12) | |
at ComponentFactory_.create (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:10998:46) | |
at ComponentFactoryBoundToModule.create (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:3958:29) | |
at ApplicationRef.bootstrap (https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5769:57)` })); | |
console.log('======================\nFirefox 58\n======================'); | |
console.log(formatError('Error: something terrible has happened. oh no. oh no.', null, null, null, { stack: `AppComponent@https://angular-axqlkx.stackblitz.io/tmp/appfiles/app/app.component.ts:31:29 | |
createClass@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12200:20 | |
createDirectiveInstance@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:12049:37 | |
createViewNodes@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13487:53 | |
createRootView@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:13377:5 | |
callWithDebugContext@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14778:39 | |
debugCreateRootView@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:14079:12 | |
ComponentFactory_.prototype.create@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:10998:37 | |
ComponentFactoryBoundToModule.prototype.create@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:3958:16 | |
ApplicationRef.prototype.bootstrap@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5769:40 | |
PlatformRef.prototype._moduleDoBootstrap/<@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5496:74 | |
PlatformRef.prototype._moduleDoBootstrap@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5496:13 | |
PlatformRef.prototype.bootstrapModuleFactory/</</<@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:5417:21 | |
ZoneDelegate.prototype.invoke@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:392:17 | |
onInvoke@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:4665:24 | |
ZoneDelegate.prototype.invoke@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:391:17 | |
Zone.prototype.run@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:142:24 | |
scheduleResolveOrReject/<@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:873:52 | |
ZoneDelegate.prototype.invokeTask@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:425:17 | |
onInvokeTask@https://angular-axqlkx.stackblitz.io/turbo_modules/@angular/core@5.0.0/bundles/core.umd.js:4656:24 | |
ZoneDelegate.prototype.invokeTask@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:424:17 | |
Zone.prototype.runTask@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:192:28 | |
drainMicroTaskQueue@https://angular-axqlkx.stackblitz.io/turbo_modules/zone.js@0.8.18/dist/zone.js:602:25 | |
E/</<@https://c.staticblitz.com/assets/packs/common-7c635cf1d1bf1b16dfee.js:1:35475 | |
E/<@https://c.staticblitz.com/assets/packs/common-7c635cf1d1bf1b16dfee.js:1:35345 | |
a@https://c.staticblitz.com/assets/packs/common-7c635cf1d1bf1b16dfee.js:1:26331` })); | |
console.log('======================\nEdge 16\n======================'); | |
console.log(formatError('Error: something terrible has happened. oh no. oh no.', null, null, null, { stack: `Error: something terrible has happened. oh no. oh no. | |
at AppComponent (eval code:31:21) | |
at createClass (eval code:12200:13) | |
at createDirectiveInstance (eval code:12049:5) | |
at createViewNodes (eval code:13487:21) | |
at createRootView (eval code:13377:5) | |
at callWithDebugContext (eval code:14778:9) | |
at debugCreateRootView (eval code:14079:5) | |
at ComponentFactory_.prototype.create (eval code:10998:9) | |
at ComponentFactoryBoundToModule.prototype.create (eval code:3958:9) | |
at ApplicationRef.prototype.bootstrap (eval code:5769:9)` })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment