Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 8fffe70

Browse files
KwintenPmhevery
authored andcommitted
Fixed the long stack trace example (#349)
* The longStackTraceZoneSpec delegates the handling of the error to the parent zone. Without the changes I've made, the handling was passed to the 'root' zone which doesn't handle the error object. By adding a parentZone which handles the printing of the error in the 'onHandleError' hook, the full stack trace is visible. * Fixed the formatting (back to before).
1 parent 27ca2a9 commit 8fffe70

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: example/basic.html

+8-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,14 @@ <h1>Basic Example</h1>
4646
* Bootstrap the app
4747
*/
4848
//main();
49-
Zone.current.fork(Zone.longStackTraceZoneSpec).run(main);
49+
Zone.current.fork(
50+
{
51+
onHandleError: function (parentZoneDelegate, currentZone, targetZone, error) {
52+
console.log(error.stack);
53+
}
54+
}
55+
).fork(Zone.longStackTraceZoneSpec).run(main);
5056

5157
</script>
5258
</body>
53-
</html>
59+
</html>

0 commit comments

Comments
 (0)