Only log duplicated route navigation failures in dev
#1088 (closed) restores reporting Vue Router errors to the console and to Sentry, but those are thrown too often now because Vue Router is too broad in its definition of a navigation failure. This can cause a lot of spurious errors in Sentry as merely double-clicking one of the navbar buttons can cause errors to occur:
Sentry Issue: ARKINDEX-FRONTEND-AVA
Error: Duplicated route: from /browse/ to /browse/. type="16"
Duplicated route: from /browse/ to /browse/. type="16"
There doesn't appear to be any way to detect when a duplicated navigation failure is an actual error or not, so the best we can do is just make the errors visible in dev builds where we will be troubleshooting and reproducing issues, and not report them in production builds so that they don't get through to Sentry. So only log, with no Sentry.captureException
, when process.env.NODE_ENV != 'production'
.