The previous attempt at merely reading a property of event.target was incorrect. It worked at first but errors reappeared later, so must have been a reace. This wraps the entire navigation event handlers in the try-catch, and then checks for the very specific error and suppresses it. Other errors are rethrown as is.