const routerPush = Router.prototype.push; Router.prototype.push = function push(location) { return routerPush.call(this, location).catch(error => error); };