Skip to content

Commit f86a8fa

Browse files
committed
warn error if no router.onError() callback is registered
1 parent 7731488 commit f86a8fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/history/base.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ export class History {
8383
const current = this.current
8484
const abort = err => {
8585
if (err instanceof Error) {
86-
this.errorCbs.forEach(cb => { cb(err) })
86+
if (this.errorCbs.length) {
87+
this.errorCbs.forEach(cb => { cb(err) })
88+
} else {
89+
warn(false, 'uncaught error during route navigation:')
90+
console.error(err)
91+
}
8792
}
8893
onAbort && onAbort(err)
8994
}

0 commit comments

Comments
 (0)