]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
feat(devtools): group navigation errors
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 14 Jun 2021 15:53:14 +0000 (17:53 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 14 Jun 2021 15:53:19 +0000 (17:53 +0200)
src/devtools.ts

index 1b270b1677e912e7ab6c42847a5dff7286cfaef9..c54b5e102c21e2d99eb59a5dea0d5cc0d9313a77 100644 (file)
@@ -136,15 +136,16 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) {
       //   color: 0xea5455,
       // })
 
-      router.onError(error => {
+      router.onError((error, to) => {
         api.addTimelineEvent({
           layerId: navigationsLayerId,
           event: {
-            title: 'Error',
-            subtitle: 'An uncaught error happened during navigation',
+            title: 'Error during Navigation',
+            subtitle: to.fullPath,
             logType: 'error',
             time: Date.now(),
             data: { error },
+            groupId: (to.meta as any).__navigationId,
           },
         })
       })
@@ -172,6 +173,7 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) {
           event: {
             time: Date.now(),
             title: 'Start of navigation',
+            subtitle: to.fullPath,
             data,
             groupId: (to.meta as any).__navigationId,
           },
@@ -209,6 +211,7 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) {
           layerId: navigationsLayerId,
           event: {
             title: 'End of navigation',
+            subtitle: to.fullPath,
             time: Date.now(),
             data,
             logType: failure ? 'warning' : 'default',