Remove custom error message for invalid guards
refactor(router): Remove custom error message for invalid guards (#46678)
Remove custom error message for invalid guardsrefactorremove custom error message invalid guards
Committed by atscott
commit message
refactor(router): Remove custom error message for invalid guards (#46678)
This custom error message for invalid guards requires a fair bit of
extra logic in several places. This change reduces special logic for an error
case that would fail anyways. Additionally, there were already a couple
places that _did not_ have this special error and we have not seen any
indication that there is more confusion for those (resolvers and canMatch).
PR Close #46678Editor assessment
An exemplar of removal rationale. The subject states the change plainly - remove the custom error message for invalid guards - and the body argues the trade-off honestly: the message required special logic in several places, the guarded case would fail anyway, and code paths without the special error showed no added confusion. That is evidence-based reasoning a reviewer can evaluate. Accurate refactor framing and clean hygiene complete it. The evidence-based reasoning - redundant logic, inevitable failure, precedent without confusion - is exactly what reviewers want from a removal.